Changeset 7327
- Timestamp:
- 03/16/08 09:49:10 (6 months ago)
- Files:
-
- trunk/wp-admin/includes/class-ftp.php (modified) (1 diff)
- trunk/wp-admin/includes/class-wp-filesystem-ftpext.php (modified) (3 diffs)
- trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php (modified) (2 diffs)
- trunk/wp-admin/includes/file.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/includes/class-ftp.php
r7257 r7327 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 trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r7300 r7327 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){ … … 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; … … 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; trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r7300 r7327 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 … … 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 ) trunk/wp-admin/includes/file.php
r7238 r7327 326 326 327 327 if ( extension_loaded('ftp') ) return 'ftpext'; 328 if ( extension_loaded('sockets') ) return 'ftpsockets';328 if ( extension_loaded('sockets') || function_exists('fsockopen') ) return 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread 329 329 return false; 330 330 }
