refactor(MailPlugin): Continue execution after extracting email instead of calling itself

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2026-05-26 09:46:03 +02:00
parent d92aac8f7d
commit 1c7e381858
No known key found for this signature in database

View file

@ -67,9 +67,8 @@ class MailPlugin implements ISearchPlugin {
}
// Extract the email address from "Foo Bar <foo.bar@example.tld>" and then search with "foo.bar@example.tld" instead
$result = preg_match('/<([^@]+@.+)>$/', $search, $matches);
if ($result && filter_var($matches[1], FILTER_VALIDATE_EMAIL)) {
return $this->search($matches[1], $limit, $offset, $searchResult);
if (preg_match('/<([^@]+@.+)>$/', $search, $matches) && filter_var($matches[1], FILTER_VALIDATE_EMAIL)) {
$search = $matches[1];
}
$currentUserId = $this->userSession->getUser()->getUID();