Ticket #6245: 6245.diff
| File 6245.diff, 2.8 kB (added by DD32, 6 months ago) |
|---|
-
wp-admin/includes/class-ftp.php
old new 317 317 function pwd() { 318 318 if(!$this->_exec("PWD", "pwd")) return FALSE; 319 319 if(!$this->_checkCode()) return FALSE; 320 return ereg_replace("^[0-9]{3} \"(.+)\" .+".CRLF, "\\1", $this->_message);320 return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message); 321 321 } 322 322 323 323 function cdup() { -
wp-admin/includes/class-wp-filesystem-ftpext.php
old new 162 162 return $ret; 163 163 } 164 164 function cwd(){ 165 return ftp_pwd($this->link); 165 $cwd = ftp_pwd($this->link); 166 if( $cwd ) 167 $cwd = trailingslashit($cwd); 168 return $cwd; 166 169 } 167 170 function chdir($dir){ 168 171 return @ftp_chdir($dir); … … 308 311 } 309 312 function is_dir($path){ 310 313 $cwd = $this->cwd(); 311 @ftp_chdir($this->link, $path); 312 if ( $this->cwd() != $cwd ) { 314 $result = @ftp_chdir($this->link, $path); 315 if( $result && $path == $this->cwd() || 316 $this->cwd() != $cwd ) { 313 317 @ftp_chdir($this->link, $cwd); 314 318 return true; 315 319 } … … 425 429 } else { 426 430 $limitFile = false; 427 431 } 428 //if( ! $this->is_dir($path) ) 429 // return false;430 $list = ftp_rawlist($this->link , '-a ' . $path, false); 432 433 $list = @ftp_rawlist($this->link , '-a ' . $path, false); 434 431 435 if ( $list === false ) 432 436 return false; 433 437 -
wp-admin/includes/class-wp-filesystem-ftpsockets.php
old new 176 176 } 177 177 178 178 function cwd(){ 179 return $this->ftp->pwd(); 179 $cwd = $this->ftp->pwd(); 180 if( $cwd ) 181 $cwd = trailingslashit($cwd); 182 return $cwd; 180 183 } 181 184 182 185 function chdir($file){ … … 388 391 } else { 389 392 $limitFile = false; 390 393 } 391 //if( ! $this->is_dir($path) ) 392 // return false; 394 393 395 $list = $this->ftp->dirlist($path); 394 396 if( ! $list ) 395 397 return false; -
wp-admin/includes/file.php
old new 325 343 } 326 344 327 345 if ( extension_loaded('ftp') ) return 'ftpext'; 328 if ( extension_loaded('sockets') ) return 'ftpsockets';346 if ( extension_loaded('sockets') || function_exists('fsockopen') ) return 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread 329 347 return false; 330 348 } 331 349
