From de3178dc1a5117827e254544c6f164dba653ad83 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Tue, 28 Jul 2009 23:13:45 +0000 Subject: [PATCH] PHP 5.3 deprecated ereg() function (#2820952) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13793 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index d7774d63..eeb5c7d4 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -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 -- 2.25.1