Changeset 3189


Ignore:
Timestamp:
08/11/10 12:34:46 (18 months ago)
Author:
benedikt
Message:
  • [TOOLS] Fixed #2053: Make ispCP ω PHP 5.3 compatible (part III): Made Squirrelmail Plugins PHP 5.3 compatible
Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r3186 r3189  
    88        - GUI: 
    99                * Default/Disabled Page CSS embedded in CDATA tags 
     10        - TOOLS: 
     11                * Fixed #2053: Make ispCP ω PHP 5.3 compatible (part III): 
     12                                Made Squirrelmail Plugins PHP 5.3 compatible 
    1013 
    11142010-08-11 Laurent Declercq 
  • trunk/gui/tools/webmail/plugins/abook_take/setup.php

    r1638 r3189  
    3535    global $Email_RegExp_Match; 
    3636   
    37     if (! eregi('^' . $Email_RegExp_Match . '$', $email)) 
     37    /* @author ispCP PHP5.3 Compatibility Changes */ 
     38    if (! preg_match('/^' . $Email_RegExp_Match . '$/i', $email)) 
    3839        return false; 
    3940     
     
    4849    global $abook_found_email, $Email_RegExp_Match; 
    4950 
    50     while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) 
     51        /* @author ispCP PHP5.3 Compatibility Change */ 
     52    while (preg_match('/(' . $Email_RegExp_Match . ')/i', $str, $hits)) 
    5153    { 
    5254        $str = substr(strstr($str, $hits[0]), strlen($hits[0])); 
  • trunk/gui/tools/webmail/plugins/add_address/add_addresses.php

    r2693 r3189  
    138138               // 
    139139               $errstr = $aa_abook->error; 
    140                $errstr = ereg_replace('^\[.*\] *', '', $errstr); 
     140                           /* @author ispCP PHP5.3 Compatibility Change */ 
     141               $errstr = preg_replace('/^\[.*\] */', '', $errstr); 
    141142               $errors[$i][] = sprintf(_("%s for address number %s"), $errstr, $disp_number); 
    142143            } 
  • trunk/gui/tools/webmail/plugins/add_address/functions.php

    r2693 r3189  
    716716   // check formatting 
    717717   // 
    718    if (!eregi('^' . $Email_RegExp_Match . '$', $email)) 
     718   /* @author ispCP PHP5.3 Compatibility Change */ 
     719   if (!preg_match('/^' . $Email_RegExp_Match . '$/i', $email)) 
    719720      return FALSE; 
    720721 
  • trunk/gui/tools/webmail/plugins/bookmarks/bookmark_create.php

    r1638 r3189  
    7676                $explode = explode("</TITLE>",$sString); 
    7777                $sString = $explode[0]; 
    78                 $title = ereg_replace("(\r\n|\n|\r)", "", $sString); 
     78                /* @author ispCP PHP5.3 Compatibility Change */ 
     79                $title = preg_replace("(\r\n|\n|\r)", "", $sString); 
    7980                } 
    8081        } 
  • trunk/gui/tools/webmail/plugins/bookmarks/bookmark_edit.php

    r1638 r3189  
    8585                        $explode = explode("</TITLE>",$sString); 
    8686                        $sString = $explode[0]; 
    87                         $title = ereg_replace("(\r\n|\n|\r)", "", $sString); 
     87                        /* @author ispCP PHP5.3 Compatibility Change */ 
     88                        $title = preg_replace("/(\r\n|\n|\r)/", "", $sString); 
    8889                        } 
    8990                } 
  • trunk/gui/tools/webmail/plugins/disk_quota/details.php

    r1638 r3189  
    4242$dq_grace = $_POST["dq_grace"]; 
    4343if ( $dq_blocks >= $dq_quota ) { 
    44     list ($dq_grace1, $dq_grace2) = split (":", $dq_grace); 
     44        /* @author ispCP 5.3 Compatibility Change */ 
     45    list ($dq_grace1, $dq_grace2) = explode (":", $dq_grace); 
    4546    if ( strlen($dq_grace2) >= 1 ) { 
    4647        if ( $dq_grace2 == "day" || $dq_grace2 == "days" ) { 
  • trunk/gui/tools/webmail/plugins/disk_quota/disk_quota.php

    r1638 r3189  
    4444    for ( $i=2 ; $i<sizeof($quota_data) ; $i++ ) { 
    4545 
     46        /* @author ispCP 5.3 Compatibility Change */ 
    4647        list($dq_fsname, $dq_blocks, $dq_quota, $dq_limit, $dq_grace) = 
    47                 split( "[[:blank:]]+", trim($quota_data[$i]) ); 
     48                explode( "[[:blank:]]+", trim($quota_data[$i]) ); 
    4849        if ( strlen($dq_fsname) != 0 && strlen($dq_blocks) == 0 && strlen($dq_quota) == 0 ) { 
     50                        /* @author ispCP 5.3 Compatibility Change */ 
    4951                list($dq_blocks, $dq_quota, $dq_limit, $dq_grace) = 
    50                         split( "[[:blank:]]+", trim($quota_data[$i+1]) ); 
     52                        explode( "[[:blank:]]+", trim($quota_data[$i+1]) ); 
    5153                $i++; 
    5254        } 
  • trunk/gui/tools/webmail/plugins/gpg/gpg.php

    r1638 r3189  
    8181            $j = substr_count($uidstring, "[User id not found]"); 
    8282            if ($j) { $this->email_name='Unknown'; return; } 
    83             $matches = split("[<>]", $uidstring); 
     83            /* @author ispCP PHP5.3 Compatibility Change */ 
     84            $matches = explode("[<>]", $uidstring); 
    8485            switch (count($matches)) { 
    8586                case 1: 
  • trunk/gui/tools/webmail/plugins/gpg/gpg_decrypt_attach.php

    r1638 r3189  
    7979             $languages[$squirrelmail_language]['XTRA_CODE']('downloadfilename', $filename, $HTTP_USER_AGENT); 
    8080         } else { 
    81              $filename = ereg_replace('[\\/:\*\?"<>\|;]', '_', str_replace('&nbsp;', ' ', $filename)); 
     81                         /* @author ispCP PHP5.3 Compatibility Change */ 
     82             $filename = preg_replace('/[\\/:\*\?"<>\|;]/', '_', str_replace('&nbsp;', ' ', $filename)); 
    8283         } 
    8384 
  • trunk/gui/tools/webmail/plugins/gpg/gpg_hook_functions.php

    r1638 r3189  
    826826    // THIS IS VERY IMPORTANT. Must make sure all the lines end in \r\n 
    827827    // see RFC3156 section 5 
    828     $messageSignedText = ereg_replace("\r\n", "\n", $messageSignedText ); 
    829     $messageSignedText = ereg_replace("\r", "\n", $messageSignedText ); 
    830     $messageSignedText = ereg_replace("\n", "\r\n", $messageSignedText ); 
     828        /* @author ispCP PHP5.3 Compatibility Change */ 
     829    $messageSignedText = preg_replace("/\r\n/", "\n", $messageSignedText ); 
     830    $messageSignedText = preg_replace("/\r/", "\n", $messageSignedText ); 
     831    $messageSignedText = preg_replace("/\n/", "\r\n", $messageSignedText ); 
    831832 
    832833    //$messageSignedText = escapeshellarg($messageSignedText); 
    833     $messageSignedText = ereg_replace("\"", "\\\"", $messageSignedText ); 
     834    $messageSignedText = preg_replace("/\"/", "\\\"", $messageSignedText ); 
    834835 
    835836 
  • trunk/gui/tools/webmail/plugins/gpg/gpg_key_functions.php

    r1638 r3189  
    248248      $key_date = $bits[5]; 
    249249      $matches=array(); 
    250       eregi(".*(<.*>).*", $bits[9], $matches); 
     250          /* @author ispCP PHP5.3 Compatibility Change */ 
     251      preg_match("/.*(<.*>).*/i", $bits[9], $matches); 
    251252      $email_str = htmlspecialchars($bits[9]); 
    252253      $email_addr = htmlspecialchars($matches[1]); 
     
    492493        $line=str_replace("&quot;","&",$line); 
    493494 
    494         if (ereg("^pub[[:space:]]+([[:digit:]]+[R|D])/([[:alnum:]]+)[[:space:]]+([[:digit:]]+)/([[:digit:]]+)/([[:digit:]]+)[[:space:]]+(.*)", $line, $tmp)) { 
     495                /* @author ispCP PHP5.3 Compatibility Change */ 
     496        if (preg_match("/^pub[[:space:]]+([[:digit:]]+[R|D])\/([[:alnum:]]+)[[:space:]]+([[:digit:]]+)\/([[:digit:]]+)\/([[:digit:]]+)[[:space:]]+(.*)/", $line, $tmp)) { 
    495497        // foreach ($tmp as $key => $value) echo "<br>regex $key = $value"; 
    496498            $lastkey = $tmp[2]; 
     
    499501 
    500502        } 
    501         if (ereg("(.+)<(.+@.+)>", $line, $t)) { 
     503                /* @author ispCP PHP5.3 Compatibility Change */ 
     504        if (preg_match("/(.+)<(.+@.+)>/", $line, $t)) { 
    502505            $tmpemail = $t[2]; 
    503506            $tmpname = $t[1]; 
  • trunk/gui/tools/webmail/plugins/gpg/gpg_keyring.php

    r1638 r3189  
    8686 
    8787    //Email address info. 
    88     $matches = split("[<>]", $parts[9]); 
     88        /* @author ispCP PHP5.3 Compatibility Change */ 
     89    $matches = explode("[<>]", $parts[9]); 
    8990    switch (count($matches)) { 
    9091        case 1: 
     
    100101        default: 
    101102                //Patch to parse user info lines properly provided by Lars Kruse <devel@sumpfralle.de> 
    102             ereg ("^(.*)<([^>]*)>([^>]*)$", $parts[9], $infos); 
     103                /* @author ispCP PHP5.3 Compatibility Change */ 
     104            preg_match("/^(.*)<([^>]*)>([^>]*)$/", $parts[9], $infos); 
    103105            $ret['email_name'] = $infos[1]; 
    104106            $ret['email_addr'] = $infos[2]; 
  • trunk/gui/tools/webmail/plugins/gpg/gpg_pref_functions.php

    r1638 r3189  
    5555          if (substr($line,0,1) == '#') continue; 
    5656          $matches=array(); 
    57           eregi("^([[:alnum:]|_]+)=(.*)", $line, $matches); 
     57                /* @author ispCP PHP5.3 Compatibility Change */ 
     58          preg_match("/^([[:alnum:]|_]+)=(.*)/i", $line, $matches); 
    5859          $GLOBALS['GPG_SYSTEM_OPTIONS'][trim($matches[1])] = trim($matches[2]); 
    5960          if (trim($matches[1])=='systemkeyringfile') { 
  • trunk/gui/tools/webmail/plugins/gpg/modules/genkey_keygen.php

    r1638 r3189  
    248248            { 
    249249                //echo ("<br>" . htmlspecialchars($thing)); 
    250                 if (ereg("sec[[:space:]]+([[:digit:]]+[R|D|G])/([[:alnum:]]+)[[:space:]]+(.*)", $thing, $tmp)) 
     250                        /* @author ispCP PHP5.3 Compatibility Change */ 
     251                if (preg_match("/sec[[:space:]]+([[:digit:]]+[R|D|G])\/([[:alnum:]]+)[[:space:]]+(.*)/", $thing, $tmp)) 
    251252                    $key_id = $tmp[2]; 
    252253            } 
  • trunk/gui/tools/webmail/plugins/html_mail/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php

    r1638 r3189  
    3838        $GLOBALS["UserFilesPath"] = '/UserFiles/' ; 
    3939 
    40 if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) ) 
     40/* @author ispCP PHP5.3 Compatibility Change */ 
     41if ( ! preg_match( '#/$#', $GLOBALS["UserFilesPath"] ) ) 
    4142        $GLOBALS["UserFilesPath"] .= '/' ; 
    4243 
     
    4546        $GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ; 
    4647 
    47         if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) ) 
     48        /* @author ispCP PHP5.3 Compatibility Change */ 
     49        if ( ! preg_match( '#/$#', $GLOBALS["UserFilesDirectory"] ) ) 
    4850                $GLOBALS["UserFilesDirectory"] .= '/' ; 
    4951} 
     
    7072                return ; 
    7173 
    72         // Check the current folder syntax (must begin and start with a slash). 
    73         if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ; 
     74        // Check the current folder syntax (must begin and start with a slash).# 
     75        /* @author ispCP PHP5.3 Compatibility Change */ 
     76        if ( ! preg_match( '#/$#', $sCurrentFolder ) ) $sCurrentFolder .= '/' ; 
    7477        if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ; 
    7578         
  • trunk/gui/tools/webmail/plugins/html_mail/fckeditor/editor/filemanager/browser/mcpuk/connectors/php/Commands/GetFolders.php

    r1638 r3189  
    4848                                                        //check if$fckphp_configured not to show this folder 
    4949                                                        $hide=false; 
     50                                                        /* @author ispCP PHP5.3 Compatibility Change */ 
    5051                                                        for($i=0;$i<sizeof($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders']);$i++)  
    51                                                                 $hide=(ereg($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i],$filename)?true:$hide); 
     52                                                                $hide=(preg_match('/'.$this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i].'/',$filename)?true:$hide); 
    5253                                                         
    5354                                                        if (!$hide) echo "<Folder name=\"$filename\" />\n"; 
  • trunk/gui/tools/webmail/plugins/html_mail/fckeditor/editor/filemanager/browser/mcpuk/connectors/php/Commands/GetFoldersAndFiles.php

    r1638 r3189  
    7575                                                        //check if$fckphp_configured not to show this folder 
    7676                                                        $hide=false; 
     77                                                        /* @author ispCP PHP5.3 Compatibility Change */ 
    7778                                                        for($i=0;$i<sizeof($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders']);$i++)  
    78                                                                 $hide=(ereg($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i],$filename)?true:$hide); 
     79                                                                $hide=(preg_match('/'.$this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i].'/',$filename)?true:$hide); 
    7980                                                         
    8081                                                        if (!$hide) echo "\t\t<Folder name=\"$filename\" />\n"; 
     
    99100                                        //check if$fckphp_configured not to show this file 
    100101                                        $editable=$hide=false; 
     102                                        /* @author ispCP PHP5.3 Compatibility Change */ 
    101103                                        for($j=0;$j<sizeof($this->fckphp_config['ResourceAreas'][$this->type]['HideFiles']);$j++)  
    102                                                 $hide=(ereg($this->fckphp_config['ResourceAreas'][$this->type]['HideFiles'][$j],$files[$i])?true:$hide); 
     104                                                $hide=(preg_match('/'.$this->fckphp_config['ResourceAreas'][$this->type]['HideFiles'][$j].'/',$files[$i])?true:$hide); 
    103105                                         
    104106                                        if (!$hide) { 
  • trunk/gui/tools/webmail/plugins/html_mail/functions.php

    r1638 r3189  
    14901490    } 
    14911491 
    1492     ereg("^([\t >]*)([^\t >].*)?$", $line, $regs); 
     1492        /* @author ispCP PHP5.3 Compatibility Change */ 
     1493    preg_match("/^([\t >]*)([^\t >].*)?$/", $line, $regs); 
    14931494    $beginning_spaces = $regs[1]; 
    14941495    if (isset($regs[2])) { 
  • trunk/gui/tools/webmail/plugins/preview_pane/source_files/read_body.php-squirrelmail-1.4.3

    r1638 r3189  
    189189    // This merely comes from compose.php and only happens when there is no 
    190190    // email_addr specified in user's identity (which is the startup config) 
    191     if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) { 
     191        /* @author ispCP PHP5.3 Compatibility Change */ 
     192    if (preg_match("/^([^@%\/]+)[@%\/](.+)$/", $username, $usernamedata)) { 
    192193       $popuser = $usernamedata[1]; 
    193194       $domain  = $usernamedata[2]; 
  • trunk/gui/tools/webmail/plugins/preview_pane/source_files/read_body.php-squirrelmail-1.5.1

    r1638 r3189  
    150150    // This merely comes from compose.php and only happens when there is no 
    151151    // email_addr specified in user's identity (which is the startup config) 
    152     if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) { 
     152        /* @author ispCP PHP5.3 Compatibility Change */ 
     153    if (preg_match("/^([^@%\/]+)[@%\/](.+)$/", $username, $usernamedata)) { 
    153154       $popuser = $usernamedata[1]; 
    154155       $domain  = $usernamedata[2]; 
  • trunk/gui/tools/webmail/plugins/squirrelspell/modules/forget_me_not.mod

    r2693 r3189  
    2828 * Dirty: yes. Is there a better solution? Let me know. ;) 
    2929 */ 
    30 $new_words = ereg_replace("%", "\n", $words); 
     30/* @author ispCP PHP5.3 Compatibility Change */ 
     31$new_words = preg_replace("/%/", "\n", $words); 
    3132/** 
    3233 * Load the user dictionary and see if there is anything in it. 
  • trunk/gui/tools/webmail/plugins/todo/todo.php

    r1638 r3189  
    9393 
    9494        $todo_deadline = todo_get_todo_dl($todos, $todo_index); 
    95         list($todo_dl_y, $todo_dl_m, $todo_dl_d) = split('-' ,$todo_deadline, 3); 
     95        /* @author ispCP PHP5.3 Compatibility Change */ 
     96        list($todo_dl_y, $todo_dl_m, $todo_dl_d) = explode('-' ,$todo_deadline, 3); 
    9697        $todo_title = todo_get_todo_title($todos, $todo_index);; 
    9798        $todo_desc = todo_get_todo_desc($todos, $todo_index);; 
Note: See TracChangeset for help on using the changeset viewer.