WordPress.org

Make WordPress Core

Ticket #16026: wp_php_5.3.patch

File wp_php_5.3.patch, 6.5 KB (added by NorwayFun, 7 years ago)
  • trunk/wp-admin/includes/class-ftp.php

    diff -ur wpsvn/trunk/wp-admin/includes/class-ftp.php wpsvn_patched/trunk/wp-admin/includes/class-ftp.php
    old new  
    380380        function pwd() {
    381381                if(!$this->_exec("PWD", "pwd")) return FALSE;
    382382                if(!$this->_checkCode()) return FALSE;
    383                 return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);
     383                return mb_ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);
    384384        }
    385385
    386386        function cdup() {
     
    424424                }
    425425                if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
    426426                if(!$this->_checkCode()) return FALSE;
    427                 return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
     427                return mb_ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
    428428        }
    429429
    430430        function abort() {
     
    444444                }
    445445                if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
    446446                if(!$this->_checkCode()) return FALSE;
    447                 $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
     447                $mdtm = mb_ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
    448448                $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
    449449                $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
    450450                return $timestamp;
     
    818818        function glob_regexp($pattern,$probe) {
    819819                $sensitive=(PHP_OS!='WIN32');
    820820                return ($sensitive?
    821                         ereg($pattern,$probe):
    822                         eregi($pattern,$probe)
     821                        mb_ereg($pattern,$probe):
     822                        mb_eregi($pattern,$probe)
    823823                );
    824824        }
    825825
  • trunk/wp-admin/includes/class-ftp-pure.php

    diff -ur wpsvn/trunk/wp-admin/includes/class-ftp-pure.php wpsvn_patched/trunk/wp-admin/includes/class-ftp-pure.php
    old new  
    110110                                $this->_data_close();
    111111                                return FALSE;
    112112                        }
    113                         $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
     113                        $ip_port = explode(",", mb_ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
    114114                        $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
    115115            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
    116116                        $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
  • trunk/wp-admin/includes/class-ftp-sockets.php

    diff -ur wpsvn/trunk/wp-admin/includes/class-ftp-sockets.php wpsvn_patched/trunk/wp-admin/includes/class-ftp-sockets.php
    old new  
    131131                                $this->_data_close();
    132132                                return FALSE;
    133133                        }
    134                         $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
     134                        $ip_port = explode(",", mb_ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
    135135                        $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
    136136            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
    137137                        $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
  • trunk/wp-includes/class-phpmailer.php

    diff -ur wpsvn/trunk/wp-includes/class-phpmailer.php wpsvn_patched/trunk/wp-includes/class-phpmailer.php
    old new  
    589589    /* Retry while there is no connection */
    590590    while($index < count($hosts) && $connection == false) {
    591591      $hostinfo = array();
    592       if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
     592      if(mb_eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
    593593        $host = $hostinfo[1];
    594594        $port = $hostinfo[2];
    595595      } else {
  • trunk/wp-includes/class-pop3.php

    diff -ur wpsvn/trunk/wp-includes/class-pop3.php wpsvn_patched/trunk/wp-includes/class-pop3.php
    old new  
    252252        $MsgArray = array();
    253253
    254254        $line = fgets($fp,$buffer);
    255         while ( !ereg("^\.\r\n",$line))
     255        while ( !mb_ereg("^\.\r\n",$line))
    256256        {
    257257            $MsgArray[$count] = $line;
    258258            $count++;
     
    319319            if($msgC > $Total) { break; }
    320320            $line = fgets($fp,$this->BUFFER);
    321321            $line = $this->strip_clf($line);
    322             if(ereg("^\.",$line))
     322            if(@mb_ereg("^\.",$line))
    323323            {
    324324                $this->ERROR = "POP3 pop_list: " . _("Premature end of list");
    325325                return false;
     
    365365        $MsgArray = array();
    366366
    367367        $line = fgets($fp,$buffer);
    368         while ( !ereg("^\.\r\n",$line))
     368        while ( !mb_ereg("^\.\r\n",$line))
    369369        {
    370370            if ( $line[0] == '.' ) { $line = substr($line,1); }
    371371            $MsgArray[$count] = $line;
     
    553553            $line = "";
    554554            $count = 1;
    555555            $line = fgets($fp,$buffer);
    556             while ( !ereg("^\.\r\n",$line)) {
    557                 if(ereg("^\.\r\n",$line)) {
     556            while ( !mb_ereg("^\.\r\n",$line)) {
     557                if(mb_ereg("^\.\r\n",$line)) {
    558558                    break;
    559559                }
    560560                list ($msg,$msgUidl) = preg_split('/\s+/',$line);
     
    606606        if( empty($cmd) )
    607607            return false;
    608608        else
    609             return( ereg ("^\+OK", $cmd ) );
     609            return( mb_ereg ("^\+OK", $cmd ) );
    610610    }
    611611
    612612    function strip_clf ($text = "") {
  • trunk/wp-settings.php

    diff -ur wpsvn/trunk/wp-settings.php wpsvn_patched/trunk/wp-settings.php
    old new  
    2323// Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
    2424wp_initial_constants( );
    2525
    26 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
    27 set_magic_quotes_runtime( 0 );
     26// disable magic quotes depending on PHP version
     27if (strpos($_SERVER['SERVER_SOFTWARE'], 'PHP/5.3') !== false) {
     28        if(get_magic_quotes_runtime()) {
     29                set_magic_quotes_runtime(false);}
     30        }else{
     31                set_magic_quotes_runtime( 0 );
     32        }
     33
    2834@ini_set( 'magic_quotes_sybase', 0 );
    2935
    3036// Set default timezone in PHP 5.