diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index ddfdd1d6..58828416 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -667,7 +667,7 @@ class Image { /** * Send list of metatags to be parsed. * - * @param [] $metatags + * @param string[] $metatags * @param int $image_id */ public function parse_metatags($metatags, $image_id) { @@ -876,7 +876,7 @@ class Image { * Merge all the image metadata searches into one generic querylet * and append to the base querylet with "AND blah" */ - if($img_querylets) { + if(!empty($img_querylets)) { $n = 0; $img_sql = ""; $img_vars = array(); @@ -950,11 +950,11 @@ class Image { assert('$positive_tag_id_array || $negative_tag_id_array'); $wheres = array(); - if ($positive_tag_id_array) { + if (!empty($positive_tag_id_array)) { $positive_tag_id_list = join(', ', $positive_tag_id_array); $wheres[] = "tag_id IN ($positive_tag_id_list)"; } - if ($negative_tag_id_array) { + if (!empty($negative_tag_id_array)) { $negative_tag_id_list = join(', ', $negative_tag_id_array); $wheres[] = "tag_id NOT IN ($negative_tag_id_list)"; } diff --git a/core/page.class.php b/core/page.class.php index 9b60c99c..3d02bbe6 100644 --- a/core/page.class.php +++ b/core/page.class.php @@ -290,7 +290,7 @@ class Page { # header("Cache-control: no-cache"); # header('Expires: ' . gmdate('D, d M Y H:i:s', time() - 600) . ' GMT'); #} - if($this->get_cookie("flash_message")) { + if($this->get_cookie("flash_message") !== null) { $this->add_cookie("flash_message", "", -1, "/"); } usort($this->blocks, "blockcmp"); diff --git a/core/util.inc.php b/core/util.inc.php index 274219e8..94cf1eb0 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -79,7 +79,7 @@ function sql_escape($input) { /** * Turn all manner of HTML / INI / JS / DB booleans into a PHP one * - * @param $input + * @param mixed $input * @return bool */ function bool_escape($input) { @@ -679,7 +679,7 @@ function captcha_check() { else { session_start(); $securimg = new Securimage(); - if($securimg->check($_POST['captcha_code']) == FALSE) { + if($securimg->check($_POST['captcha_code']) === false) { log_info("core", "Captcha failed (Securimage)"); return false; } @@ -736,7 +736,7 @@ function getMimeType($file, $ext="", $list=false) { 'mp4' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm' ); - if ($list == true){ return $exts; } + if ($list === true){ return $exts; } if (isset($exts[$ext])) { return $exts[$ext]; } @@ -831,7 +831,7 @@ function get_memory_limit() { // Shimmie wants more memory than what PHP is currently set for. // Attempt to set PHP's memory limit. - if ( ini_set("memory_limit", $shimmie_limit) === FALSE ) { + if ( ini_set("memory_limit", $shimmie_limit) === false ) { /* We can't change PHP's limit, oh well, return whatever its currently set to */ return $memory; } diff --git a/ext/index/theme.php b/ext/index/theme.php index a574555b..ecc0b496 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -1,7 +1,7 @@