- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-ftp.php
r46626 r32990 1 1 <?php 2 2 /** 3 * PemFTP - A nFtp implementation in pure PHP3 * PemFTP - A Ftp implementation in pure PHP 4 4 * 5 5 * @package PemFTP 6 * @since 2.5 .06 * @since 2.5 7 7 * 8 8 * @version 1.0 9 9 * @copyright Alexey Dotsenko 10 10 * @author Alexey Dotsenko 11 * @link http s://www.phpclasses.org/package/1743-PHP-FTP-client-in-pure-PHP.html12 * @license LGPL http s://opensource.org/licenses/lgpl-license.html11 * @link http://www.phpclasses.org/browse/package/1743.html Site 12 * @license LGPL http://www.opensource.org/licenses/lgpl-license.html 13 13 */ 14 14 … … 18 18 * This can be redefined. 19 19 * 20 * @since 2.5 .020 * @since 2.5 21 21 * @var string 22 22 */ … … 28 28 * This can be redefined. 29 29 * 30 * @since 2.5 .030 * @since 2.5 31 31 * @var int 32 32 */ … … 36 36 * 37 37 * This can be redefined. 38 * @since 2.5 .038 * @since 2.5 39 39 * @var int 40 40 */ … … 44 44 * 45 45 * This can be redefined. 46 * @since 2.5 .046 * @since 2.5 47 47 * @var int 48 48 */ … … 54 54 * This can be redefined. 55 55 * 56 * @since 2.5 .056 * @since 2.5 57 57 * @var bool 58 58 */ … … 60 60 61 61 /** 62 * @since 2.5 .062 * @since 2.5 63 63 * @var string 64 64 */ … … 66 66 67 67 /** 68 * @since 2.5 .068 * @since 2.5 69 69 * @var string 70 70 */ … … 72 72 73 73 /** 74 * @since 2.5 .074 * @since 2.5 75 75 * @var string 76 76 */ … … 186 186 if ($lcount<8) return ''; 187 187 $b = array(); 188 $b['isdir'] = $lucifer[0] [0]=== "d";189 $b['islink'] = $lucifer[0] [0]=== "l";188 $b['isdir'] = $lucifer[0]{0} === "d"; 189 $b['islink'] = $lucifer[0]{0} === "l"; 190 190 if ( $b['isdir'] ) 191 191 $b['type'] = 'd'; … … 208 208 $b['day'] = $lucifer[6]; 209 209 if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { 210 $b['year'] = gmdate("Y");210 $b['year'] = date("Y"); 211 211 $b['hour'] = $l2[1]; 212 212 $b['minute'] = $l2[2]; … … 381 381 if(!$this->_exec("PWD", "pwd")) return FALSE; 382 382 if(!$this->_checkCode()) return FALSE; 383 return preg_replace("/^[0-9]{3} \"(.+)\".*$/s", "\\1", $this->_message);383 return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message); 384 384 } 385 385 … … 425 425 if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; 426 426 if(!$this->_checkCode()) return FALSE; 427 return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);427 return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); 428 428 } 429 429 … … 445 445 if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; 446 446 if(!$this->_checkCode()) return FALSE; 447 $mdtm = preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);447 $mdtm = ereg_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]); … … 525 525 } 526 526 527 function fget($fp, $remotefile, 527 function fget($fp, $remotefile,$rest=0) { 528 528 if($this->_can_restore and $rest!=0) fseek($fp, $rest); 529 529 $pi=pathinfo($remotefile); … … 584 584 } 585 585 586 function fput($remotefile, $fp , $rest=0) {586 function fput($remotefile, $fp) { 587 587 if($this->_can_restore and $rest!=0) fseek($fp, $rest); 588 588 $pi=pathinfo($remotefile); … … 695 695 foreach($list as $k=>$v) { 696 696 $list[$k]=$this->parselisting($v); 697 if( ! $list[$k] or$list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);697 if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); 698 698 } 699 699 $ret=true; … … 728 728 foreach($list as $k=>$v) { 729 729 $list[$k]=$this->parselisting($v); 730 if( ! $list[$k] or$list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);730 if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); 731 731 } 732 732 $ret=true; … … 776 776 } else $path=getcwd(); 777 777 if(is_array($handle) and !empty($handle)) { 778 foreach($handle as $dir) {778 while($dir=each($handle)) { 779 779 if($this->glob_pattern_match($pattern,$dir)) 780 780 $output[]=$dir; … … 819 819 $sensitive=(PHP_OS!='WIN32'); 820 820 return ($sensitive? 821 preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ):822 preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe)821 ereg($pattern,$probe): 822 eregi($pattern,$probe) 823 823 ); 824 824 } … … 905 905 906 906 require_once dirname( __FILE__ ) . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php"; 907 908 if ( $mod_sockets ) {909 class ftp extends ftp_sockets {}910 } else {911 class ftp extends ftp_pure {}912 }
Note: See TracChangeset
for help on using the changeset viewer.