Ticket #8331: trim-return-bool.diff
| File trim-return-bool.diff, 852 bytes (added by , 17 years ago) |
|---|
-
wp-admin/includes/class-wp-filesystem-ssh2.php
161 161 $data .= $buf; 162 162 } 163 163 fclose($stream); 164 $data = str_replace("__COMMAND_FINISHED__", "", $data);164 $data = trim(str_replace("__COMMAND_FINISHED__", "", $data)); 165 165 if (($returnbool) && ( (int) $data )) { 166 166 return true; 167 167 } elseif (($returnbool) && (! (int) $data )) { … … 311 311 312 312 function exists($file) { 313 313 $this->debug("exists();"); 314 $list = $this->run_command($this->link, sprintf('ls -lad %s', $file)); 315 return (bool) $list; 314 return $this->run_command($this->link, sprintf('ls -lad %s', $file), true); 316 315 } 317 316 318 317 function is_file($file) {