fixing a problem regarding substr_count/mb_substr_count as they do not support the same number of parameters

This commit is contained in:
Klaus Leithoff 2009-11-20 12:17:31 +00:00
parent bb69cb6baf
commit 30cceec6dc

View File

@ -2363,8 +2363,8 @@ class Net_IMAPProtocol {
if ($str[$pos] === $startDelim) $delimCount++;
if ($str[$pos] === $stopDelim) $delimCount--;
if ($str[$pos] === $stopDelim && ($str[$pos+1] === $startDelim || ($str[$pos+1] === $stopDelim && $delimCount<=0))) {
$numOfQuotes = substr_count($str,'"',$startingpos);
$numOfMaskedQuotes = substr_count($str,'\"',$startingpos);
$numOfQuotes = substr_count(substr($str,$startingpos),'"');
$numOfMaskedQuotes = substr_count(substr($str,$startingpos),'\"');
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");