PHP 5.3 deprecated ereg() function (#2820952)
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 28 Jul 2009 23:13:45 +0000 (23:13 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 28 Jul 2009 23:13:45 +0000 (23:13 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13793 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index d7774d63cd235b9452429c1b346915ab2aae704c..eeb5c7d407dd17f2b14e3a580399e56144f499b1 100755 (executable)
@@ -110,8 +110,7 @@ function compact_mailboxes_response($ary) {
      */
     for ($i = 0, $iCnt=count($ary); $i < $iCnt; $i++) {
         if (isset($ary[$i + 1]) && substr($ary[$i], -3) == "}\r\n") {
-            if (ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
-                 $ary[$i], $regs)) {
+            if (preg_match('/^(\* [A-Z]+.*)\{[0-9]+\}([ \n\r\t]*)$/', $ary[$i], $regs)) {
                 $ary[$i] = $regs[1] . '"' . addslashes(trim($ary[$i+1])) . '"' . $regs[2];
                 array_splice($ary, $i+1, 2);
             }
@@ -676,8 +675,7 @@ function sqimap_mailbox_parse ($line) {
         $boxesall[$g]['id'] = $g;
 
         $boxesall[$g]['flags'] = array();
-        if (isset($line[$g])) {
-            ereg("\(([^)]*)\)",$line[$g],$regs);
+        if (isset($line[$g]) && preg_match('/\(([^)]*)\)/',$line[$g],$regs) ) {
             /**
              * Since 1.5.1 flags are stored with RFC3501 naming
              * and also the old way for backwards compatibility