mirror of
https://github.com/itflow-org/itflow
synced 2026-08-16 20:45:12 +00:00
Update imapengine dependancies too
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user