Fix for namespace parsing. UWash has a namespace prefix without a delimiter, which...
authoravel <avel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 2 Nov 2006 12:54:14 +0000 (12:54 +0000)
committeravel <avel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 2 Nov 2006 12:54:14 +0000 (12:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11943 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index d1c18d9..38ef572 100755 (executable)
@@ -1118,9 +1118,14 @@ function sqimap_parse_namespace(&$input) {
                 if($c = preg_match_all('/\((?:(.*?)\s*?)\)/', $ns, $regs2)) {
                     $namespace[$ns_strings[$i]] = array();
                     for($j=0; $j<sizeof($regs2[1]); $j++) {
-                        preg_match('/"(.*)"\s+"(.*)"/', $regs2[1][$j], $regs3);
+                        preg_match('/"(.*)"\s+("(.*)"|NIL)/', $regs2[1][$j], $regs3);
                         $namespace[$ns_strings[$i]][$j]['prefix'] = $regs3[1];
-                        $namespace[$ns_strings[$i]][$j]['delimiter'] = $regs3[2];
+                        if($regs3[2] == 'NIL') {
+                            $namespace[$ns_strings[$i]][$j]['delimiter'] = null;
+                        } else {
+                            // $regs[3] is $regs[2] without the quotes
+                            $namespace[$ns_strings[$i]][$j]['delimiter'] = $regs3[3];
+                        }
                         unset($regs3);
                     }
                 }