Ticket #16302: 16302.diff
File 16302.diff, 51.3 KB (added by , 14 years ago) |
---|
-
wp-admin/admin.php
12 12 * @since 2.3.2 13 13 */ 14 14 if ( ! defined('WP_ADMIN') ) 15 define('WP_ADMIN', TRUE);15 define('WP_ADMIN', true); 16 16 17 17 if ( ! defined('WP_NETWORK_ADMIN') ) 18 define('WP_NETWORK_ADMIN', FALSE);18 define('WP_NETWORK_ADMIN', false); 19 19 20 20 if ( ! defined('WP_USER_ADMIN') ) 21 define('WP_USER_ADMIN', FALSE);21 define('WP_USER_ADMIN', false); 22 22 23 23 if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) { 24 define('WP_BLOG_ADMIN', TRUE);24 define('WP_BLOG_ADMIN', true); 25 25 } 26 26 27 27 if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') ) -
wp-admin/includes/class-ftp-pure.php
27 27 */ 28 28 class ftp extends ftp_base { 29 29 30 function ftp($verb= FALSE, $le=FALSE) {30 function ftp($verb=false, $le=false) { 31 31 $this->__construct($verb, $le); 32 32 } 33 33 34 function __construct($verb= FALSE, $le=FALSE) {34 function __construct($verb=false, $le=false) { 35 35 parent::__construct(false, $verb, $le); 36 36 } 37 37 … … 43 43 if(!@stream_set_timeout($sock, $this->_timeout)) { 44 44 $this->PushError('_settimeout','socket set send timeout'); 45 45 $this->_quit(); 46 return FALSE;46 return false; 47 47 } 48 return TRUE;48 return true; 49 49 } 50 50 51 51 function _connect($host, $port) { … … 53 53 $sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout); 54 54 if (!$sock) { 55 55 $this->PushError('_connect','socket connect failed', $errstr." (".$errno.")"); 56 return FALSE;56 return false; 57 57 } 58 58 $this->_connected=true; 59 59 return $sock; … … 62 62 function _readmsg($fnction="_readmsg"){ 63 63 if(!$this->_connected) { 64 64 $this->PushError($fnction, 'Connect first'); 65 return FALSE;65 return false; 66 66 } 67 67 $result=true; 68 68 $this->_message=""; … … 86 86 function _exec($cmd, $fnction="_exec") { 87 87 if(!$this->_ready) { 88 88 $this->PushError($fnction,'Connect first'); 89 return FALSE;89 return false; 90 90 } 91 91 if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; 92 92 $status=@fputs($this->_ftp_control_sock, $cmd.CRLF); 93 93 if($status===false) { 94 94 $this->PushError($fnction,'socket write failed'); 95 return FALSE;95 return false; 96 96 } 97 97 $this->_lastaction=time(); 98 if(!$this->_readmsg($fnction)) return FALSE;99 return TRUE;98 if(!$this->_readmsg($fnction)) return false; 99 return true; 100 100 } 101 101 102 102 function _data_prepare($mode=FTP_ASCII) { 103 if(!$this->_settype($mode)) return FALSE;103 if(!$this->_settype($mode)) return false; 104 104 if($this->_passive) { 105 105 if(!$this->_exec("PASV", "pasv")) { 106 106 $this->_data_close(); 107 return FALSE;107 return false; 108 108 } 109 109 if(!$this->_checkCode()) { 110 110 $this->_data_close(); 111 return FALSE;111 return false; 112 112 } 113 113 $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); 114 114 $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; … … 118 118 if(!$this->_ftp_data_sock) { 119 119 $this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")"); 120 120 $this->_data_close(); 121 return FALSE;121 return false; 122 122 } 123 123 else $this->_ftp_data_sock; 124 124 } else { 125 125 $this->SendMSG("Only passive connections available!"); 126 return FALSE;126 return false; 127 127 } 128 return TRUE;128 return true; 129 129 } 130 130 131 131 function _data_read($mode=FTP_ASCII, $fp=NULL) { … … 133 133 else $out=""; 134 134 if(!$this->_passive) { 135 135 $this->SendMSG("Only passive connections available!"); 136 return FALSE;136 return false; 137 137 } 138 138 while (!feof($this->_ftp_data_sock)) { 139 139 $block=fread($this->_ftp_data_sock, $this->_ftp_buff_size); … … 149 149 else $out=""; 150 150 if(!$this->_passive) { 151 151 $this->SendMSG("Only passive connections available!"); 152 return FALSE;152 return false; 153 153 } 154 154 if(is_resource($fp)) { 155 155 while(!feof($fp)) { … … 157 157 if(!$this->_data_write_block($mode, $block)) return false; 158 158 } 159 159 } elseif(!$this->_data_write_block($mode, $fp)) return false; 160 return TRUE;160 return true; 161 161 } 162 162 163 163 function _data_write_block($mode, $block) { 164 164 if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); 165 165 do { 166 if(($t=@fwrite($this->_ftp_data_sock, $block))=== FALSE) {166 if(($t=@fwrite($this->_ftp_data_sock, $block))===false) { 167 167 $this->PushError("_data_write","Can't write to socket"); 168 return FALSE;168 return false; 169 169 } 170 170 $block=substr($block, $t); 171 171 } while(!empty($block)); … … 175 175 function _data_close() { 176 176 @fclose($this->_ftp_data_sock); 177 177 $this->SendMSG("Disconnected data from remote host"); 178 return TRUE;178 return true; 179 179 } 180 180 181 function _quit($force= FALSE) {181 function _quit($force=false) { 182 182 if($this->_connected or $force) { 183 183 @fclose($this->_ftp_control_sock); 184 184 $this->_connected=false; -
wp-admin/includes/class-ftp-sockets.php
27 27 */ 28 28 class ftp extends ftp_base { 29 29 30 function ftp($verb= FALSE, $le=FALSE) {30 function ftp($verb=false, $le=false) { 31 31 $this->__construct($verb, $le); 32 32 } 33 33 34 function __construct($verb= FALSE, $le=FALSE) {34 function __construct($verb=false, $le=false) { 35 35 parent::__construct(true, $verb, $le); 36 36 } 37 37 … … 43 43 if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { 44 44 $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); 45 45 @socket_close($sock); 46 return FALSE;46 return false; 47 47 } 48 48 if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { 49 49 $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); 50 50 @socket_close($sock); 51 return FALSE;51 return false; 52 52 } 53 53 return true; 54 54 } … … 57 57 $this->SendMSG("Creating socket"); 58 58 if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { 59 59 $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); 60 return FALSE;60 return false; 61 61 } 62 if(!$this->_settimeout($sock)) return FALSE;62 if(!$this->_settimeout($sock)) return false; 63 63 $this->SendMSG("Connecting to \"".$host.":".$port."\""); 64 64 if (!($res = @socket_connect($sock, $host, $port))) { 65 65 $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); 66 66 @socket_close($sock); 67 return FALSE;67 return false; 68 68 } 69 69 $this->_connected=true; 70 70 return $sock; … … 73 73 function _readmsg($fnction="_readmsg"){ 74 74 if(!$this->_connected) { 75 75 $this->PushError($fnction,'Connect first'); 76 return FALSE;76 return false; 77 77 } 78 78 $result=true; 79 79 $this->_message=""; … … 97 97 function _exec($cmd, $fnction="_exec") { 98 98 if(!$this->_ready) { 99 99 $this->PushError($fnction,'Connect first'); 100 return FALSE;100 return false; 101 101 } 102 102 if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; 103 103 $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); 104 104 if($status===false) { 105 105 $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); 106 return FALSE;106 return false; 107 107 } 108 108 $this->_lastaction=time(); 109 if(!$this->_readmsg($fnction)) return FALSE;110 return TRUE;109 if(!$this->_readmsg($fnction)) return false; 110 return true; 111 111 } 112 112 113 113 function _data_prepare($mode=FTP_ASCII) { 114 if(!$this->_settype($mode)) return FALSE;114 if(!$this->_settype($mode)) return false; 115 115 $this->SendMSG("Creating data socket"); 116 116 $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 117 117 if ($this->_ftp_data_sock < 0) { 118 118 $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); 119 return FALSE;119 return false; 120 120 } 121 121 if(!$this->_settimeout($this->_ftp_data_sock)) { 122 122 $this->_data_close(); 123 return FALSE;123 return false; 124 124 } 125 125 if($this->_passive) { 126 126 if(!$this->_exec("PASV", "pasv")) { 127 127 $this->_data_close(); 128 return FALSE;128 return false; 129 129 } 130 130 if(!$this->_checkCode()) { 131 131 $this->_data_close(); 132 return FALSE;132 return false; 133 133 } 134 134 $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); 135 135 $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; … … 138 138 if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { 139 139 $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); 140 140 $this->_data_close(); 141 return FALSE;141 return false; 142 142 } 143 143 else $this->_ftp_temp_sock=$this->_ftp_data_sock; 144 144 } else { 145 145 if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { 146 146 $this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); 147 147 $this->_data_close(); 148 return FALSE;148 return false; 149 149 } 150 150 if(!@socket_bind($this->_ftp_data_sock,$addr)){ 151 151 $this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); 152 152 $this->_data_close(); 153 return FALSE;153 return false; 154 154 } 155 155 if(!@socket_listen($this->_ftp_data_sock)) { 156 156 $this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); 157 157 $this->_data_close(); 158 return FALSE;158 return false; 159 159 } 160 160 if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { 161 161 $this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); 162 162 $this->_data_close(); 163 return FALSE;163 return false; 164 164 } 165 165 if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { 166 166 $this->_data_close(); 167 return FALSE;167 return false; 168 168 } 169 169 if(!$this->_checkCode()) { 170 170 $this->_data_close(); 171 return FALSE;171 return false; 172 172 } 173 173 } 174 return TRUE;174 return true; 175 175 } 176 176 177 177 function _data_read($mode=FTP_ASCII, $fp=NULL) { … … 181 181 if(!$this->_passive) { 182 182 $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); 183 183 $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); 184 if($this->_ftp_temp_sock=== FALSE) {184 if($this->_ftp_temp_sock===false) { 185 185 $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); 186 186 $this->_data_close(); 187 return FALSE;187 return false; 188 188 } 189 189 } 190 190 … … 204 204 if(!$this->_passive) { 205 205 $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); 206 206 $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); 207 if($this->_ftp_temp_sock=== FALSE) {207 if($this->_ftp_temp_sock===false) { 208 208 $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); 209 209 $this->_data_close(); 210 210 return false; … … 222 222 function _data_write_block($mode, $block) { 223 223 if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); 224 224 do { 225 if(($t=@socket_write($this->_ftp_temp_sock, $block))=== FALSE) {225 if(($t=@socket_write($this->_ftp_temp_sock, $block))===false) { 226 226 $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); 227 227 $this->_data_close(); 228 return FALSE;228 return false; 229 229 } 230 230 $block=substr($block, $t); 231 231 } while(!empty($block)); … … 236 236 @socket_close($this->_ftp_temp_sock); 237 237 @socket_close($this->_ftp_data_sock); 238 238 $this->SendMSG("Disconnected data from remote host"); 239 return TRUE;239 return true; 240 240 } 241 241 242 242 function _quit() { -
wp-admin/includes/class-ftp.php
121 121 var $AutoAsciiExt; 122 122 123 123 /* Constructor */ 124 function ftp_base($port_mode= FALSE) {124 function ftp_base($port_mode=false) { 125 125 $this->__construct($port_mode); 126 126 } 127 127 128 function __construct($port_mode= FALSE, $verb=FALSE, $le=FALSE) {128 function __construct($port_mode=false, $verb=false, $le=false) { 129 129 $this->LocalEcho=$le; 130 130 $this->Verbose=$verb; 131 131 $this->_lastaction=NULL; … … 134 134 $this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY); 135 135 $this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS'); 136 136 $this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT"); 137 $this->_port_available=($port_mode== TRUE);137 $this->_port_available=($port_mode==true); 138 138 $this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support")); 139 $this->_connected= FALSE;140 $this->_ready= FALSE;141 $this->_can_restore= FALSE;139 $this->_connected=false; 140 $this->_ready=false; 141 $this->_can_restore=false; 142 142 $this->_code=0; 143 143 $this->_message=""; 144 144 $this->_ftp_buff_size=4096; … … 228 228 echo $message.($crlf?CRLF:""); 229 229 flush(); 230 230 } 231 return TRUE;231 return true; 232 232 } 233 233 234 234 function SetType($mode=FTP_AUTOASCII) { 235 235 if(!in_array($mode, $this->AuthorizedTransferMode)) { 236 236 $this->SendMSG("Wrong type"); 237 return FALSE;237 return false; 238 238 } 239 239 $this->_type=$mode; 240 240 $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) ); 241 return TRUE;241 return true; 242 242 } 243 243 244 244 function _settype($mode=FTP_ASCII) { 245 245 if($this->_ready) { 246 246 if($mode==FTP_BINARY) { 247 247 if($this->_curtype!=FTP_BINARY) { 248 if(!$this->_exec("TYPE I", "SetType")) return FALSE;248 if(!$this->_exec("TYPE I", "SetType")) return false; 249 249 $this->_curtype=FTP_BINARY; 250 250 } 251 251 } elseif($this->_curtype!=FTP_ASCII) { 252 if(!$this->_exec("TYPE A", "SetType")) return FALSE;252 if(!$this->_exec("TYPE A", "SetType")) return false; 253 253 $this->_curtype=FTP_ASCII; 254 254 } 255 } else return FALSE;256 return TRUE;255 } else return false; 256 return true; 257 257 } 258 258 259 259 function Passive($pasv=NULL) { … … 261 261 else $this->_passive=$pasv; 262 262 if(!$this->_port_available and !$this->_passive) { 263 263 $this->SendMSG("Only passive connections available!"); 264 $this->_passive= TRUE;265 return FALSE;264 $this->_passive=true; 265 return false; 266 266 } 267 267 $this->SendMSG("Passive mode ".($this->_passive?"on":"off")); 268 return TRUE;268 return true; 269 269 } 270 270 271 271 function SetServer($host, $port=21, $reconnect=true) { 272 272 if(!is_long($port)) { 273 273 $this->verbose=true; 274 274 $this->SendMSG("Incorrect port syntax"); 275 return FALSE;275 return false; 276 276 } else { 277 277 $ip=@gethostbyname($host); 278 278 $dns=@gethostbyaddr($host); … … 283 283 $ipaslong = ip2long($ip); 284 284 if ( ($ipaslong == false) || ($ipaslong === -1) ) { 285 285 $this->SendMSG("Wrong host name/address \"".$host."\""); 286 return FALSE;286 return false; 287 287 } 288 288 $this->_host=$ip; 289 289 $this->_fullhost=$dns; … … 294 294 if($reconnect){ 295 295 if($this->_connected) { 296 296 $this->SendMSG("Reconnecting"); 297 if(!$this->quit(FTP_FORCE)) return FALSE;298 if(!$this->connect()) return FALSE;297 if(!$this->quit(FTP_FORCE)) return false; 298 if(!$this->connect()) return false; 299 299 } 300 300 } 301 return TRUE;301 return true; 302 302 } 303 303 304 304 function SetUmask($umask=0022) { 305 305 $this->_umask=$umask; 306 306 umask($this->_umask); 307 307 $this->SendMSG("UMASK 0".decoct($this->_umask)); 308 return TRUE;308 return true; 309 309 } 310 310 311 311 function SetTimeout($timeout=30) { 312 312 $this->_timeout=$timeout; 313 313 $this->SendMSG("Timeout ".$this->_timeout); 314 314 if($this->_connected) 315 if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE;316 return TRUE;315 if(!$this->_settimeout($this->_ftp_control_sock)) return false; 316 return true; 317 317 } 318 318 319 319 function connect($server=NULL) { … … 324 324 $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]); 325 325 if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) { 326 326 $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\""); 327 return FALSE;327 return false; 328 328 } 329 329 $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting."); 330 330 do { 331 if(!$this->_readmsg()) return FALSE;332 if(!$this->_checkCode()) return FALSE;331 if(!$this->_readmsg()) return false; 332 if(!$this->_checkCode()) return false; 333 333 $this->_lastaction=time(); 334 334 } while($this->_code<200); 335 335 $this->_ready=true; … … 344 344 } 345 345 if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled"); 346 346 else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); 347 return TRUE;347 return true; 348 348 } 349 349 350 350 function quit($force=false) { 351 351 if($this->_ready) { 352 if(!$this->_exec("QUIT") and !$force) return FALSE;353 if(!$this->_checkCode() and !$force) return FALSE;352 if(!$this->_exec("QUIT") and !$force) return false; 353 if(!$this->_checkCode() and !$force) return false; 354 354 $this->_ready=false; 355 355 $this->SendMSG("Session finished"); 356 356 } 357 357 $this->_quit(); 358 return TRUE;358 return true; 359 359 } 360 360 361 361 function login($user=NULL, $pass=NULL) { … … 363 363 else $this->_login="anonymous"; 364 364 if(!is_null($pass)) $this->_password=$pass; 365 365 else $this->_password="anon@anon.com"; 366 if(!$this->_exec("USER ".$this->_login, "login")) return FALSE;367 if(!$this->_checkCode()) return FALSE;366 if(!$this->_exec("USER ".$this->_login, "login")) return false; 367 if(!$this->_checkCode()) return false; 368 368 if($this->_code!=230) { 369 if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE;370 if(!$this->_checkCode()) return FALSE;369 if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return false; 370 if(!$this->_checkCode()) return false; 371 371 } 372 372 $this->SendMSG("Authentication succeeded"); 373 373 if(empty($this->_features)) { 374 374 if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled"); 375 375 else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); 376 376 } 377 return TRUE;377 return true; 378 378 } 379 379 380 380 function pwd() { 381 if(!$this->_exec("PWD", "pwd")) return FALSE;382 if(!$this->_checkCode()) return FALSE;381 if(!$this->_exec("PWD", "pwd")) return false; 382 if(!$this->_checkCode()) return false; 383 383 return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message); 384 384 } 385 385 386 386 function cdup() { 387 if(!$this->_exec("CDUP", "cdup")) return FALSE;388 if(!$this->_checkCode()) return FALSE;387 if(!$this->_exec("CDUP", "cdup")) return false; 388 if(!$this->_checkCode()) return false; 389 389 return true; 390 390 } 391 391 392 392 function chdir($pathname) { 393 if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE;394 if(!$this->_checkCode()) return FALSE;395 return TRUE;393 if(!$this->_exec("CWD ".$pathname, "chdir")) return false; 394 if(!$this->_checkCode()) return false; 395 return true; 396 396 } 397 397 398 398 function rmdir($pathname) { 399 if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE;400 if(!$this->_checkCode()) return FALSE;401 return TRUE;399 if(!$this->_exec("RMD ".$pathname, "rmdir")) return false; 400 if(!$this->_checkCode()) return false; 401 return true; 402 402 } 403 403 404 404 function mkdir($pathname) { 405 if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE;406 if(!$this->_checkCode()) return FALSE;407 return TRUE;405 if(!$this->_exec("MKD ".$pathname, "mkdir")) return false; 406 if(!$this->_checkCode()) return false; 407 return true; 408 408 } 409 409 410 410 function rename($from, $to) { 411 if(!$this->_exec("RNFR ".$from, "rename")) return FALSE;412 if(!$this->_checkCode()) return FALSE;411 if(!$this->_exec("RNFR ".$from, "rename")) return false; 412 if(!$this->_checkCode()) return false; 413 413 if($this->_code==350) { 414 if(!$this->_exec("RNTO ".$to, "rename")) return FALSE;415 if(!$this->_checkCode()) return FALSE;416 } else return FALSE;417 return TRUE;414 if(!$this->_exec("RNTO ".$to, "rename")) return false; 415 if(!$this->_checkCode()) return false; 416 } else return false; 417 return true; 418 418 } 419 419 420 420 function filesize($pathname) { 421 421 if(!isset($this->_features["SIZE"])) { 422 422 $this->PushError("filesize", "not supported by server"); 423 return FALSE;423 return false; 424 424 } 425 if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;426 if(!$this->_checkCode()) return FALSE;425 if(!$this->_exec("SIZE ".$pathname, "filesize")) return false; 426 if(!$this->_checkCode()) return false; 427 427 return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); 428 428 } 429 429 430 430 function abort() { 431 if(!$this->_exec("ABOR", "abort")) return FALSE;431 if(!$this->_exec("ABOR", "abort")) return false; 432 432 if(!$this->_checkCode()) { 433 if($this->_code!=426) return FALSE;434 if(!$this->_readmsg("abort")) return FALSE;435 if(!$this->_checkCode()) return FALSE;433 if($this->_code!=426) return false; 434 if(!$this->_readmsg("abort")) return false; 435 if(!$this->_checkCode()) return false; 436 436 } 437 437 return true; 438 438 } … … 440 440 function mdtm($pathname) { 441 441 if(!isset($this->_features["MDTM"])) { 442 442 $this->PushError("mdtm", "not supported by server"); 443 return FALSE;443 return false; 444 444 } 445 if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;446 if(!$this->_checkCode()) return FALSE;445 if(!$this->_exec("MDTM ".$pathname, "mdtm")) return false; 446 if(!$this->_checkCode()) return false; 447 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]); … … 451 451 } 452 452 453 453 function systype() { 454 if(!$this->_exec("SYST", "systype")) return FALSE;455 if(!$this->_checkCode()) return FALSE;454 if(!$this->_exec("SYST", "systype")) return false; 455 if(!$this->_checkCode()) return false; 456 456 $DATA = explode(" ", $this->_message); 457 457 return array($DATA[1], $DATA[3]); 458 458 } 459 459 460 460 function delete($pathname) { 461 if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE;462 if(!$this->_checkCode()) return FALSE;463 return TRUE;461 if(!$this->_exec("DELE ".$pathname, "delete")) return false; 462 if(!$this->_checkCode()) return false; 463 return true; 464 464 } 465 465 466 466 function site($command, $fnction="site") { 467 if(!$this->_exec("SITE ".$command, $fnction)) return FALSE;468 if(!$this->_checkCode()) return FALSE;469 return TRUE;467 if(!$this->_exec("SITE ".$command, $fnction)) return false; 468 if(!$this->_checkCode()) return false; 469 return true; 470 470 } 471 471 472 472 function chmod($pathname, $mode) { 473 if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE;474 return TRUE;473 if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return false; 474 return true; 475 475 } 476 476 477 477 function restore($from) { 478 478 if(!isset($this->_features["REST"])) { 479 479 $this->PushError("restore", "not supported by server"); 480 return FALSE;480 return false; 481 481 } 482 482 if($this->_curtype!=FTP_BINARY) { 483 483 $this->PushError("restore", "can't restore in ASCII mode"); 484 return FALSE;484 return false; 485 485 } 486 if(!$this->_exec("REST ".$from, "resore")) return FALSE;487 if(!$this->_checkCode()) return FALSE;488 return TRUE;486 if(!$this->_exec("REST ".$from, "resore")) return false; 487 if(!$this->_checkCode()) return false; 488 return true; 489 489 } 490 490 491 491 function features() { 492 if(!$this->_exec("FEAT", "features")) return FALSE;493 if(!$this->_checkCode()) return FALSE;492 if(!$this->_exec("FEAT", "features")) return false; 493 if(!$this->_checkCode()) return false; 494 494 $f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY); 495 495 $this->_features=array(); 496 496 foreach($f as $k=>$v) { … … 514 514 515 515 function file_exists($pathname) { 516 516 $exists=true; 517 if(!$this->_exec("RNFR ".$pathname, "rename")) $exists= FALSE;517 if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=false; 518 518 else { 519 if(!$this->_checkCode()) $exists= FALSE;519 if(!$this->_checkCode()) $exists=false; 520 520 $this->abort(); 521 521 } 522 522 if($exists) $this->SendMSG("Remote file ".$pathname." exists"); … … 530 530 if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; 531 531 else $mode=FTP_BINARY; 532 532 if(!$this->_data_prepare($mode)) { 533 return FALSE;533 return false; 534 534 } 535 535 if($this->_can_restore and $rest!=0) $this->restore($rest); 536 536 if(!$this->_exec("RETR ".$remotefile, "get")) { 537 537 $this->_data_close(); 538 return FALSE;538 return false; 539 539 } 540 540 if(!$this->_checkCode()) { 541 541 $this->_data_close(); 542 return FALSE;542 return false; 543 543 } 544 544 $out=$this->_data_read($mode, $fp); 545 545 $this->_data_close(); 546 if(!$this->_readmsg()) return FALSE;547 if(!$this->_checkCode()) return FALSE;546 if(!$this->_readmsg()) return false; 547 if(!$this->_checkCode()) return false; 548 548 return $out; 549 549 } 550 550 … … 554 554 $fp = @fopen($localfile, "w"); 555 555 if (!$fp) { 556 556 $this->PushError("get","can't open local file", "Cannot create \"".$localfile."\""); 557 return FALSE;557 return false; 558 558 } 559 559 if($this->_can_restore and $rest!=0) fseek($fp, $rest); 560 560 $pi=pathinfo($remotefile); … … 562 562 else $mode=FTP_BINARY; 563 563 if(!$this->_data_prepare($mode)) { 564 564 fclose($fp); 565 return FALSE;565 return false; 566 566 } 567 567 if($this->_can_restore and $rest!=0) $this->restore($rest); 568 568 if(!$this->_exec("RETR ".$remotefile, "get")) { 569 569 $this->_data_close(); 570 570 fclose($fp); 571 return FALSE;571 return false; 572 572 } 573 573 if(!$this->_checkCode()) { 574 574 $this->_data_close(); 575 575 fclose($fp); 576 return FALSE;576 return false; 577 577 } 578 578 $out=$this->_data_read($mode, $fp); 579 579 fclose($fp); 580 580 $this->_data_close(); 581 if(!$this->_readmsg()) return FALSE;582 if(!$this->_checkCode()) return FALSE;581 if(!$this->_readmsg()) return false; 582 if(!$this->_checkCode()) return false; 583 583 return $out; 584 584 } 585 585 … … 589 589 if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; 590 590 else $mode=FTP_BINARY; 591 591 if(!$this->_data_prepare($mode)) { 592 return FALSE;592 return false; 593 593 } 594 594 if($this->_can_restore and $rest!=0) $this->restore($rest); 595 595 if(!$this->_exec("STOR ".$remotefile, "put")) { 596 596 $this->_data_close(); 597 return FALSE;597 return false; 598 598 } 599 599 if(!$this->_checkCode()) { 600 600 $this->_data_close(); 601 return FALSE;601 return false; 602 602 } 603 603 $ret=$this->_data_write($mode, $fp); 604 604 $this->_data_close(); 605 if(!$this->_readmsg()) return FALSE;606 if(!$this->_checkCode()) return FALSE;605 if(!$this->_readmsg()) return false; 606 if(!$this->_checkCode()) return false; 607 607 return $ret; 608 608 } 609 609 … … 611 611 if(is_null($remotefile)) $remotefile=$localfile; 612 612 if (!file_exists($localfile)) { 613 613 $this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\""); 614 return FALSE;614 return false; 615 615 } 616 616 $fp = @fopen($localfile, "r"); 617 617 618 618 if (!$fp) { 619 619 $this->PushError("put","can't open local file", "Cannot read file \"".$localfile."\""); 620 return FALSE;620 return false; 621 621 } 622 622 if($this->_can_restore and $rest!=0) fseek($fp, $rest); 623 623 $pi=pathinfo($localfile); … … 625 625 else $mode=FTP_BINARY; 626 626 if(!$this->_data_prepare($mode)) { 627 627 fclose($fp); 628 return FALSE;628 return false; 629 629 } 630 630 if($this->_can_restore and $rest!=0) $this->restore($rest); 631 631 if(!$this->_exec("STOR ".$remotefile, "put")) { 632 632 $this->_data_close(); 633 633 fclose($fp); 634 return FALSE;634 return false; 635 635 } 636 636 if(!$this->_checkCode()) { 637 637 $this->_data_close(); 638 638 fclose($fp); 639 return FALSE;639 return false; 640 640 } 641 641 $ret=$this->_data_write($mode, $fp); 642 642 fclose($fp); 643 643 $this->_data_close(); 644 if(!$this->_readmsg()) return FALSE;645 if(!$this->_checkCode()) return FALSE;644 if(!$this->_readmsg()) return false; 645 if(!$this->_checkCode()) return false; 646 646 return $ret; 647 647 } 648 648 … … 650 650 $local=realpath($local); 651 651 if(!@file_exists($local)) { 652 652 $this->PushError("mput","can't open local folder", "Cannot stat folder \"".$local."\""); 653 return FALSE;653 return false; 654 654 } 655 655 if(!is_dir($local)) return $this->put($local, $remote); 656 656 if(empty($remote)) $remote="."; 657 elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE;657 elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return false; 658 658 if($handle = opendir($local)) { 659 659 $list=array(); 660 660 while (false !== ($file = readdir($handle))) { … … 663 663 closedir($handle); 664 664 } else { 665 665 $this->PushError("mput","can't open local folder", "Cannot read folder \"".$local."\""); 666 return FALSE;666 return false; 667 667 } 668 if(empty($list)) return TRUE;668 if(empty($list)) return true; 669 669 $ret=true; 670 670 foreach($list as $el) { 671 671 if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el); 672 672 else $t=$this->put($local."/".$el, $remote."/".$el); 673 673 if(!$t) { 674 $ret= FALSE;674 $ret=false; 675 675 if(!$continious) break; 676 676 } 677 677 } … … 683 683 $list=$this->rawlist($remote, "-lA"); 684 684 if($list===false) { 685 685 $this->PushError("mget","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents"); 686 return FALSE;686 return false; 687 687 } 688 688 if(empty($list)) return true; 689 689 if(!@file_exists($local)) { 690 690 if(!@mkdir($local)) { 691 691 $this->PushError("mget","can't create local folder", "Cannot create folder \"".$local."\""); 692 return FALSE;692 return false; 693 693 } 694 694 } 695 695 foreach($list as $k=>$v) { … … 757 757 } 758 758 759 759 function mmkdir($dir, $mode = 0777) { 760 if(empty($dir)) return FALSE;761 if($this->is_exists($dir) or $dir == "/" ) return TRUE;760 if(empty($dir)) return false; 761 if($this->is_exists($dir) or $dir == "/" ) return true; 762 762 if(!$this->mmkdir(dirname($dir), $mode)) return false; 763 763 $r=$this->mkdir($dir, $mode); 764 764 $this->chmod($dir,$mode); … … 855 855 if(!$this->_data_prepare()) return false; 856 856 if(!$this->_exec($cmd.$arg, $fnction)) { 857 857 $this->_data_close(); 858 return FALSE;858 return false; 859 859 } 860 860 if(!$this->_checkCode()) { 861 861 $this->_data_close(); 862 return FALSE;862 return false; 863 863 } 864 864 $out=""; 865 865 if($this->_code<200) { 866 866 $out=$this->_data_read(); 867 867 $this->_data_close(); 868 if(!$this->_readmsg()) return FALSE;869 if(!$this->_checkCode()) return FALSE;870 if($out === FALSE ) return FALSE;868 if(!$this->_readmsg()) return false; 869 if(!$this->_checkCode()) return false; 870 if($out === false ) return false; 871 871 $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY); 872 872 // $this->SendMSG(implode($this->_eol_code[$this->OS_local], $out)); 873 873 } … … 896 896 } 897 897 } 898 898 899 $mod_sockets= TRUE;899 $mod_sockets=true; 900 900 if (!extension_loaded('sockets')) { 901 901 $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; 902 if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets= FALSE;902 if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=false; 903 903 } 904 904 905 905 require_once "class-ftp-".($mod_sockets?"sockets":"pure").".php"; -
wp-admin/includes/class-pclzip.php
277 277 278 278 // ----- Set default values 279 279 $v_options = array(); 280 $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;280 $v_options[PCLZIP_OPT_NO_COMPRESSION] = false; 281 281 282 282 // ----- Look for variable options arguments 283 283 $v_size = func_num_args(); … … 460 460 461 461 // ----- Set default values 462 462 $v_options = array(); 463 $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;463 $v_options[PCLZIP_OPT_NO_COMPRESSION] = false; 464 464 465 465 // ----- Look for variable options arguments 466 466 $v_size = func_num_args(); … … 720 720 $v_size = func_num_args(); 721 721 722 722 // ----- Default values for option 723 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;723 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; 724 724 725 725 // ----- Look for arguments 726 726 if ($v_size > 0) { … … 877 877 $v_size = func_num_args(); 878 878 879 879 // ----- Default values for option 880 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;880 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; 881 881 882 882 // ----- Look for arguments 883 883 if ($v_size > 1) { … … 930 930 $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; 931 931 } 932 932 if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { 933 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;933 $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false; 934 934 } 935 935 else { 936 936 } … … 1456 1456 } 1457 1457 1458 1458 // ----- Get the value 1459 $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);1459 $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); 1460 1460 $i++; 1461 1461 break; 1462 1462 … … 1523 1523 // ----- Get the value 1524 1524 if ( is_string($p_options_list[$i+1]) 1525 1525 && ($p_options_list[$i+1] != '')) { 1526 $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);1526 $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); 1527 1527 $i++; 1528 1528 } 1529 1529 else { … … 3884 3884 // ----- Decompress the file 3885 3885 $v_file_content = @gzinflate($v_buffer); 3886 3886 unset($v_buffer); 3887 if ($v_file_content === FALSE) {3887 if ($v_file_content === false) { 3888 3888 3889 3889 // ----- Change the file status 3890 3890 // TBC … … 4212 4212 $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); 4213 4213 4214 4214 // ----- Decompress the file 4215 if (($p_string = @gzinflate($v_data)) === FALSE) {4215 if (($p_string = @gzinflate($v_data)) === false) { 4216 4216 // TBC 4217 4217 } 4218 4218 } … … 5474 5474 // ----- Look for path beginning by ./ 5475 5475 if ( ($p_dir == '.') 5476 5476 || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { 5477 $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);5477 $p_dir = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_dir, 1); 5478 5478 } 5479 5479 if ( ($p_path == '.') 5480 5480 || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { 5481 $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);5481 $p_path = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_path, 1); 5482 5482 } 5483 5483 5484 5484 // ----- Explode dir and path by directory separator -
wp-admin/includes/image.php
104 104 global $_wp_additional_image_sizes; 105 105 106 106 foreach ( get_intermediate_image_sizes() as $s ) { 107 $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE);107 $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => false ); 108 108 if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) 109 109 $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes 110 110 else -
wp-admin/includes/taxonomy.php
146 146 * @since 2.0.0 147 147 * 148 148 * @param array $catarr The 'cat_ID' value is required. All other keys are optional. 149 * @return int|bool The ID number of the new or updated Category on success. Zero or FALSEon failure.149 * @return int|bool The ID number of the new or updated Category on success. Zero or false on failure. 150 150 */ 151 151 function wp_update_category($catarr) { 152 152 $cat_ID = (int) $catarr['cat_ID']; -
wp-admin/includes/template.php
1258 1258 * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. 1259 1259 * @return array Array of settings errors 1260 1260 */ 1261 function get_settings_errors( $setting = '', $sanitize = FALSE) {1261 function get_settings_errors( $setting = '', $sanitize = false ) { 1262 1262 global $wp_settings_errors; 1263 1263 1264 1264 // If $sanitize is true, manually re-run the sanitizisation for this option … … 1310 1310 * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. 1311 1311 * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted. 1312 1312 */ 1313 function settings_errors( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE) {1313 function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) { 1314 1314 1315 1315 if ($hide_on_update AND $_GET['settings-updated']) return; 1316 1316 -
wp-admin/includes/upgrade.php
1330 1330 $option = preg_replace('|/+$|', '', $option); 1331 1331 1332 1332 @ $kellogs = unserialize($option); 1333 if ($kellogs !== FALSE)1333 if ($kellogs !== false) 1334 1334 return $kellogs; 1335 1335 else 1336 1336 return $option; -
wp-admin/network/admin.php
7 7 * @since 3.1.0 8 8 */ 9 9 10 define( 'WP_NETWORK_ADMIN', TRUE);10 define( 'WP_NETWORK_ADMIN', true ); 11 11 12 12 /** Load WordPress Administration Bootstrap */ 13 13 require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' ); -
wp-admin/theme-editor.php
82 82 if (is_writeable($file)) { 83 83 //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable 84 84 $f = fopen($file, 'w+'); 85 if ($f !== FALSE) {85 if ($f !== false) { 86 86 fwrite($f, $newcontent); 87 87 fclose($f); 88 88 $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto"; -
wp-admin/user/admin.php
7 7 * @since 3.1.0 8 8 */ 9 9 10 define('WP_USER_ADMIN', TRUE);10 define('WP_USER_ADMIN', true); 11 11 12 12 require_once( dirname(dirname(__FILE__)) . '/admin.php'); 13 13 -
wp-includes/canonical.php
355 355 $requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url); 356 356 } 357 357 358 // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE358 // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning false 359 359 $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url); 360 360 361 361 if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request -
wp-includes/class-http.php
1801 1801 * @since 2.8.0 1802 1802 * 1803 1803 * @param string $url URL you intend to send this cookie to 1804 * @return boolean TRUE if allowed, FALSEotherwise.1804 * @return boolean true if allowed, false otherwise. 1805 1805 */ 1806 1806 function test( $url ) { 1807 1807 // Expires - if expired then nothing else matters -
wp-includes/class-phpass.php
49 49 50 50 $this->portable_hashes = $portable_hashes; 51 51 52 $this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compability reasons52 $this->random_state = microtime() . uniqid(rand(), true); // removed getmypid() for compability reasons 53 53 } 54 54 55 55 function get_random_bytes($count) … … 134 134 # consequently in lower iteration counts and hashes that are 135 135 # quicker to crack (by non-PHP code). 136 136 if (PHP_VERSION >= '5') { 137 $hash = md5($salt . $password, TRUE);137 $hash = md5($salt . $password, true); 138 138 do { 139 $hash = md5($hash . $password, TRUE);139 $hash = md5($hash . $password, true); 140 140 } while (--$count); 141 141 } else { 142 142 $hash = pack('H*', md5($salt . $password)); -
wp-includes/class-pop3.php
35 35 36 36 var $MAILSERVER = ''; // Set this to hard code the server name 37 37 38 var $DEBUG = FALSE; // set to true to echo pop338 var $DEBUG = false; // set to true to echo pop3 39 39 // commands and responses to error_log 40 40 // this WILL log passwords! 41 41 42 42 var $BANNER = ''; // Holds the banner returned by the 43 43 // pop server - used for apop() 44 44 45 var $ALLOWAPOP = FALSE; // Allow or disallow apop()45 var $ALLOWAPOP = false; // Allow or disallow apop() 46 46 // This must be set to true 47 47 // manually 48 48 -
wp-includes/comment-template.php
899 899 $comments_by_type = &$wp_query->comments_by_type; 900 900 } 901 901 902 $overridden_cpage = FALSE;902 $overridden_cpage = false; 903 903 if ( '' == get_query_var('cpage') && get_option('page_comments') ) { 904 904 set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 ); 905 $overridden_cpage = TRUE;905 $overridden_cpage = true; 906 906 } 907 907 908 908 if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE) … … 1190 1190 * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. 1191 1191 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. 1192 1192 */ 1193 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE) {1193 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) { 1194 1194 global $comment; 1195 1195 1196 1196 if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); -
wp-includes/compat.php
27 27 $k = $key . '%5B' . $k . '%5D'; 28 28 if ( $v === NULL ) 29 29 continue; 30 elseif ( $v === FALSE)30 elseif ( $v === false ) 31 31 $v = '0'; 32 32 33 33 if ( is_array($v) || is_object($v) ) -
wp-includes/general-template.php
2099 2099 * "Intelligently" decides to enqueue or to print the CSS file. If the 2100 2100 * 'wp_print_styles' action has *not* yet been called, the CSS file will be 2101 2101 * enqueued. If the wp_print_styles action *has* been called, the CSS link will 2102 * be printed. Printing may be forced by passing TRUEas the $force_echo2102 * be printed. Printing may be forced by passing true as the $force_echo 2103 2103 * (second) parameter. 2104 2104 * 2105 2105 * For backward compatibility with WordPress 2.3 calling method: If the $file -
wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
78 78 curl_setopt($ch, CURLOPT_URL,$url); 79 79 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 80 80 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); 81 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);81 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 82 82 $xml = curl_exec($ch); 83 83 curl_close($ch); 84 84 } else { -
wp-includes/kses.php
766 766 { 767 767 $working = 1; 768 768 $mode = 0; 769 if( FALSE=== array_key_exists($attrname, $attrarr)) {769 if(false === array_key_exists($attrname, $attrarr)) { 770 770 $attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y'); 771 771 } 772 772 $attr = preg_replace('/^\s+/', '', $attr); … … 783 783 if ( in_array(strtolower($attrname), $uris) ) 784 784 $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols); 785 785 786 if( FALSE=== array_key_exists($attrname, $attrarr)) {786 if(false === array_key_exists($attrname, $attrarr)) { 787 787 $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n'); 788 788 } 789 789 $working = 1; … … 799 799 if ( in_array(strtolower($attrname), $uris) ) 800 800 $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols); 801 801 802 if( FALSE=== array_key_exists($attrname, $attrarr)) {802 if(false === array_key_exists($attrname, $attrarr)) { 803 803 $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n'); 804 804 } 805 805 $working = 1; … … 815 815 if ( in_array(strtolower($attrname), $uris) ) 816 816 $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols); 817 817 818 if( FALSE=== array_key_exists($attrname, $attrarr)) {818 if(false === array_key_exists($attrname, $attrarr)) { 819 819 $attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n'); 820 820 } 821 821 # We add quotes to conform to W3C's HTML spec. … … 834 834 } 835 835 } # while 836 836 837 if ($mode == 1 && FALSE=== array_key_exists($attrname, $attrarr))837 if ($mode == 1 && false === array_key_exists($attrname, $attrarr)) 838 838 # special case, for when the attribute list ends with a valueless 839 839 # attribute like "selected" 840 840 $attrarr[$attrname] = array ('name' => $attrname, 'value' => '', 'whole' => $attrname, 'vless' => 'y'); -
wp-includes/link-template.php
2456 2456 $text = __('This is the short link.'); 2457 2457 2458 2458 if ( empty( $title ) ) 2459 $title = the_title_attribute( array( 'echo' => FALSE) );2459 $title = the_title_attribute( array( 'echo' => false ) ); 2460 2460 2461 2461 $shortlink = wp_get_shortlink( $post->ID ); 2462 2462 -
wp-includes/pluggable.php
1449 1449 if ( empty($wp_hasher) ) { 1450 1450 require_once( ABSPATH . 'wp-includes/class-phpass.php'); 1451 1451 // By default, use the portable hash from phpass 1452 $wp_hasher = new PasswordHash(8, TRUE);1452 $wp_hasher = new PasswordHash(8, true); 1453 1453 } 1454 1454 1455 1455 return $wp_hasher->HashPassword($password); … … 1497 1497 if ( empty($wp_hasher) ) { 1498 1498 require_once( ABSPATH . 'wp-includes/class-phpass.php'); 1499 1499 // By default, use the portable hash from phpass 1500 $wp_hasher = new PasswordHash(8, TRUE);1500 $wp_hasher = new PasswordHash(8, true); 1501 1501 } 1502 1502 1503 1503 $check = $wp_hasher->CheckPassword($password, $hash); -
wp-includes/post.php
4056 4056 * @return string SQL code that can be added to a where clause. 4057 4057 */ 4058 4058 function get_private_posts_cap_sql($post_type) { 4059 return get_posts_by_author_sql($post_type, FALSE);4059 return get_posts_by_author_sql($post_type, false); 4060 4060 } 4061 4061 4062 4062 /** … … 4070 4070 * @param int $post_author Optional. Query posts having a single author ID. 4071 4071 * @return string SQL WHERE code that can be added to a query. 4072 4072 */ 4073 function get_posts_by_author_sql($post_type, $full = TRUE, $post_author = NULL) {4073 function get_posts_by_author_sql($post_type, $full = true, $post_author = NULL) { 4074 4074 global $user_ID, $wpdb; 4075 4075 4076 4076 // Private posts -
wp-includes/theme.php
1266 1266 * 1267 1267 * Does not check the default theme, which is the fallback and should always exist. 1268 1268 * Will switch theme to the fallback theme if current theme does not validate. 1269 * You can use the 'validate_current_theme' filter to return FALSEto1269 * You can use the 'validate_current_theme' filter to return false to 1270 1270 * disable this functionality. 1271 1271 * 1272 1272 * @since 1.5.0 -
wp-includes/user.php
154 154 function count_user_posts($userid) { 155 155 global $wpdb; 156 156 157 $where = get_posts_by_author_sql('post', TRUE, $userid);157 $where = get_posts_by_author_sql('post', true, $userid); 158 158 159 159 $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); 160 160 … … 846 846 // Build a CPU-intensive query that will return concise information. 847 847 $select_count = array(); 848 848 foreach ( $avail_roles as $this_role => $name ) { 849 $select_count[] = "COUNT(NULLIF(`meta_value` LIKE '%" . like_escape($this_role) . "%', FALSE))";849 $select_count[] = "COUNT(NULLIF(`meta_value` LIKE '%" . like_escape($this_role) . "%', false))"; 850 850 } 851 851 $select_count = implode(', ', $select_count); 852 852 -
wp-login.php
606 606 $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.")); 607 607 608 608 // Some parts of this script use the main login form to display a message 609 if ( isset($_GET['loggedout']) && TRUE== $_GET['loggedout'] )609 if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) 610 610 $errors->add('loggedout', __('You are now logged out.'), 'message'); 611 611 elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) 612 612 $errors->add('registerdisabled', __('User registration is currently not allowed.'));