From da1e42a179d885b3c36c54a1d415b50474a1343a Mon Sep 17 00:00:00 2001 From: stekkel Date: Sat, 28 Jun 2003 15:34:00 +0000 Subject: [PATCH] handle escaped quotes again git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5140 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/functions/imap_general.php b/functions/imap_general.php index ea8ba293..1eeb38e3 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -774,6 +774,18 @@ function parseAddress($address, $max=0) { break; case '"': $iEnd = strpos($address,$cChar,$i+1); + if ($iEnd) { + // skip escaped quotes + $prev_char = $address{$iEnd-1}; + while ($prev_char === '\\' && substr($address,$iEnd-2,2) !== '\\\\') { + $iEnd = strpos($address,$cChar,$iEnd+1); + if ($iEnd) { + $prev_char = $address{$iEnd-1}; + } else { + $prev_char = false; + } + } + } if (!$iEnd) { $sToken = substr($address,$i); $i = $iCnt; -- 2.25.1