summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-10-16 22:04:01 +0100
committerChristopher Smith <chris@jalakai.co.uk>2013-10-16 22:04:01 +0100
commit443e135d59e9d227eec818dabf9ee64d7a73d474 (patch)
tree14c649d0a1fade810971d7e6da53471b41484fdf /inc/common.php
parent4d8acaacee33f49d51c06f6dae1dbe245018a020 (diff)
downloadrpg-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.php8
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 = '&amp;', $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 {