Ticket #16026: 16026.diff
File 16026.diff, 3.6 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-ftp-pure.php
110 110 $this->_data_close(); 111 111 return FALSE; 112 112 } 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(",", preg_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)); 114 114 $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; 115 115 $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); 116 116 $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); -
wp-admin/includes/class-ftp-sockets.php
131 131 $this->_data_close(); 132 132 return FALSE; 133 133 } 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(",", preg_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)); 135 135 $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; 136 136 $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); 137 137 $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); -
wp-admin/includes/class-ftp.php
380 380 function pwd() { 381 381 if(!$this->_exec("PWD", "pwd")) return FALSE; 382 382 if(!$this->_checkCode()) return FALSE; 383 return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);383 return preg_replace("/^[0-9]{3} \"(.+)\".+/", "\\1", $this->_message); 384 384 } 385 385 386 386 function cdup() { … … 424 424 } 425 425 if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; 426 426 if(!$this->_checkCode()) return FALSE; 427 return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);427 return preg_replace("/^[0-9]{3} ([0-9]+)".CRLF.'/', "\\1", $this->_message); 428 428 } 429 429 430 430 function abort() { … … 444 444 } 445 445 if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; 446 446 if(!$this->_checkCode()) return FALSE; 447 $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);447 $mdtm = preg_replace("/^[0-9]{3} ([0-9]+)".CRLF.'/', "\\1", $this->_message); 448 448 $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); 449 449 $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); 450 450 return $timestamp; … … 807 807 str_replace('?','.{1,1}',$pattern)))); 808 808 $out[]=$pattern; 809 809 } 810 if(count($out)==1) return($this->glob_regexp(" ^$out[0]$",$string));810 if(count($out)==1) return($this->glob_regexp("/^$out[0]$/",$string)); 811 811 else { 812 812 foreach($out as $tester) 813 813 if($this->my_regexp("^$tester$",$string)) return true; … … 816 816 } 817 817 818 818 function glob_regexp($pattern,$probe) { 819 $sensitive=(PHP_OS!='WIN32'); 820 return ($sensitive? 821 ereg($pattern,$probe): 822 eregi($pattern,$probe) 823 ); 819 $sensitive = ( PHP_OS != 'WIN32' ) ? '' : 'i'; 820 return preg_match( $pattern . $sensitive, $probe ); 824 821 } 825 822 826 823 function dirlist($remote) {