diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-10-16 22:04:01 +0100 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-10-16 22:04:01 +0100 |
commit | 443e135d59e9d227eec818dabf9ee64d7a73d474 (patch) | |
tree | 14c649d0a1fade810971d7e6da53471b41484fdf /inc/common.php | |
parent | 4d8acaacee33f49d51c06f6dae1dbe245018a020 (diff) | |
download | rpg-443e135d59e9d227eec818dabf9ee64d7a73d474.tar.gz rpg-443e135d59e9d227eec818dabf9ee64d7a73d474.tar.bz2 |
replace boolean conditional checks on possibly uninitialized vars with \!empty/empty/isset as appropriate
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/common.php b/inc/common.php index 866e0aadd..32771285b 100644 --- a/inc/common.php +++ b/inc/common.php @@ -64,7 +64,7 @@ function getSecurityToken() { */ function checkSecurityToken($token = null) { global $INPUT; - if(!$_SERVER['REMOTE_USER']) return true; // no logged in user, no need for a check + if(empty($_SERVER['REMOTE_USER'])) return true; // no logged in user, no need for a check if(is_null($token)) $token = $INPUT->str('sectok'); if(getSecurityToken() != $token) { @@ -474,13 +474,13 @@ function ml($id = '', $more = '', $direct = true, $sep = '&', $abs = false) if(is_array($more)) { // add token for resized images - if($more['w'] || $more['h'] || $isexternalimage){ + if(!empty($more['w']) || !empty($more['h']) || $isexternalimage){ $more['tok'] = media_get_token($id,$more['w'],$more['h']); } // strip defaults for shorter URLs if(isset($more['cache']) && $more['cache'] == 'cache') unset($more['cache']); - if(!$more['w']) unset($more['w']); - if(!$more['h']) unset($more['h']); + if(empty($more['w'])) unset($more['w']); + if(empty($more['h'])) unset($more['h']); if(isset($more['id']) && $direct) unset($more['id']); $more = buildURLparams($more, $sep); } else { |