handle escaped quotes again
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 28 Jun 2003 15:34:00 +0000 (15:34 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 28 Jun 2003 15:34:00 +0000 (15:34 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5140 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index ea8ba293981c0869383cea691e2178ba398ecfdb..1eeb38e3a76747076a9f79279361fdf8aebe6fc5 100755 (executable)
@@ -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;