Skip to content

Commit 2d693c4

Browse files
authored
[skip ci] Fix: Remove unused code and clean up regex patterns (GH-17791)
- Removed unused variable from getHeaders function. - Simplified regex by removing unnecessary lazy quantifiers (). - Removed unnecessary flag from regex patterns. This improves readability and reduces redundant code without altering functionality.
1 parent 07e5f6f commit 2d693c4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/standard/tests/mail/mail_util.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class MailBox
143143

144144
$this->mailConnecter->send(self::SEARCH, "UID SEARCH SUBJECT \"{$subject}\"");
145145
$res = $this->mailConnecter->getResponse(self::SEARCH);
146-
preg_match('/SEARCH ([0-9 ]+)/is', $res, $matches);
146+
preg_match('/SEARCH ([0-9 ]+)/i', $res, $matches);
147147
return isset($matches[1]) ? explode(' ', trim($matches[1])) : [];
148148
}
149149

@@ -166,8 +166,7 @@ class MailBox
166166
if (!$line) {
167167
continue;
168168
}
169-
$items = explode(':', $line);
170-
preg_match('/^(.+?):(.+?)$/', $line, $matches);
169+
preg_match('/^(.+?):(.+)$/', $line, $matches);
171170
$key = trim($matches[1] ?? '');
172171
$val = trim($matches[2] ?? '');
173172
if (!$key || !$val || $val === self::FETCH_HEADERS.' OK UID completed' || $val === ')') {

0 commit comments

Comments
 (0)