Changeset 12999
- Timestamp:
- 02/07/2010 01:59:30 AM (14 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r12998 r12999 161 161 // chmod the file or directory 162 162 if ( ! function_exists('ftp_chmod') ) 163 return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));164 return @ftp_chmod($this->link, $mode, $file);163 return (bool)@ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); 164 return (bool)@ftp_chmod($this->link, $mode, $file); 165 165 } 166 166 function chown($file, $owner, $recursive = false ) { … … 243 243 } 244 244 function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { 245 if ( ! ftp_mkdir($this->link, $path) )245 if ( !@ftp_mkdir($this->link, $path) ) 246 246 return false; 247 247 $this->chmod($path); … … 287 287 return ''; 288 288 $b = array(); 289 $b['isdir'] = $lucifer[0]{0} === "d";290 $b['islink'] = $lucifer[0]{0} === "l";289 $b['isdir'] = $lucifer[0]{0} === 'd'; 290 $b['islink'] = $lucifer[0]{0} === 'l'; 291 291 if ( $b['isdir'] ) 292 292 $b['type'] = 'd'; … … 335 335 $list = @ftp_rawlist($this->link, '-a ' . $path, false); 336 336 337 if ( $list === false )337 if ( empty($list) ) // Empty array = non-existant folder(real folder will show . at least 338 338 return false; 339 339 … … 355 355 $dirlist[ $entry['name'] ] = $entry; 356 356 } 357 358 if ( ! $dirlist )359 return false;360 357 361 358 $ret = array(); -
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r12998 r12999 225 225 226 226 function is_file($file) { 227 return $this->is_dir($file) ? false : true; 227 if ( $this->is_dir($file) ) 228 return false; 229 if ( $this->exists($file) ) 230 return true; 231 return false; 228 232 } 229 233 … … 289 293 290 294 $list = $this->ftp->dirlist($path); 291 if ( ! $list)295 if ( empty($list) && !$this->exists($path) ) 292 296 return false; 293 297
Note: See TracChangeset
for help on using the changeset viewer.