mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 17:04:14 +01:00
tackle problems with )( in Filenames
This commit is contained in:
parent
18f2db2fc8
commit
c39b2e4de1
@ -2362,8 +2362,15 @@ class Net_IMAPProtocol {
|
|||||||
if ($str[$pos] === $startDelim) $delimCount++;
|
if ($str[$pos] === $startDelim) $delimCount++;
|
||||||
if ($str[$pos] === $stopDelim) $delimCount--;
|
if ($str[$pos] === $stopDelim) $delimCount--;
|
||||||
if ($str[$pos] === $stopDelim && ($str[$pos+1] === $startDelim || ($str[$pos+1] === $stopDelim && $delimCount<=0))) {
|
if ($str[$pos] === $stopDelim && ($str[$pos+1] === $startDelim || ($str[$pos+1] === $stopDelim && $delimCount<=0))) {
|
||||||
$pos--; // stopDelimited need to be parsed outside!
|
$numOfQuotes = substr_count($str,'"');
|
||||||
return false;
|
$numOfMaskedQuotes = substr_count($str,'\"');
|
||||||
|
if ((($numOfQuotes - $numOfMaskedQuotes) % 2 ) == 0) {
|
||||||
|
// quotes are balanced, so its unlikely that we meet a stop condition here as strings may contain )(
|
||||||
|
error_log(__METHOD__. "->Length: $len; NumOfQuotes: $numOfQuotes - NumofMaskedQuotes:$numOfMaskedQuotes #".$str."\n");
|
||||||
|
} else {
|
||||||
|
$pos--; // stopDelimited need to be parsed outside!
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($str[$pos] === '\\') $pos++; // all escaped chars are overread (eg. \\, \", \x)
|
if ($str[$pos] === '\\') $pos++; // all escaped chars are overread (eg. \\, \", \x)
|
||||||
$pos++;
|
$pos++;
|
||||||
|
Loading…
Reference in New Issue
Block a user