Update imapengine dependancies too

This commit is contained in:
johnnyq
2026-08-02 01:26:40 -04:00
parent cf4446f405
commit 3e532fc792
185 changed files with 9018 additions and 4442 deletions

View File

@@ -180,17 +180,18 @@ abstract class AbstractHeader implements HeaderInterface
$tokens[] = $encodedToken;
}
foreach ($tokens as $i => $token) {
// whitespace(s) between 2 encoded tokens
if (
0 < $i
&& isset($tokens[$i + 1])
&& preg_match('~^[\t ]+$~', $token)
&& $this->tokenNeedsEncoding($tokens[$i - 1])
&& $this->tokenNeedsEncoding($tokens[$i + 1])
) {
$tokens[$i - 1] .= $token.$tokens[$i + 1];
array_splice($tokens, $i, 2);
$i = 1;
while (isset($tokens[$i + 1])) {
// whitespace-only token(s) between 2 encoded tokens; a gap of N spaces yields N - 1 of them
$j = $i;
while (preg_match('~^[\t ]+$~', $tokens[$j] ?? '')) {
++$j;
}
if ($j > $i && isset($tokens[$j]) && $this->tokenNeedsEncoding($tokens[$i - 1]) && $this->tokenNeedsEncoding($tokens[$j])) {
$tokens[$i - 1] .= implode('', \array_slice($tokens, $i, 1 + $j - $i));
array_splice($tokens, $i, 1 + $j - $i);
} else {
++$i;
}
}