From 02a06e68c910e7410b73afbbeac86843a5face4c Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 5 May 2017 00:56:01 +0300 Subject: [PATCH] Ternary operator could be simplified. (cherry picked from commit 57f0cd7) --- index.php | 2 +- library/attach_mod/includes/functions_attach.php | 2 +- library/includes/template.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 330a627f9..805d2681b 100644 --- a/index.php +++ b/index.php @@ -211,7 +211,7 @@ foreach ($cat_forums as $cid => $c) { )); $template->assign_vars(array( - 'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false, + 'H_C_AL_MESS' => ($hide_cat_opt && !$showhide), )); if (!$showhide && isset($hide_cat_user[$cid]) && !$viewcat) { diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index 82145d92c..fac3e87eb 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -253,7 +253,7 @@ function physical_filename_already_stored($filename) $num_rows = DB()->num_rows($result); DB()->sql_freeresult($result); - return ($num_rows == 0) ? false : true; + return $num_rows != 0; } /** diff --git a/library/includes/template.php b/library/includes/template.php index a2351c624..2147df9f1 100644 --- a/library/includes/template.php +++ b/library/includes/template.php @@ -774,7 +774,7 @@ class template if (!$count_if) { $keyword_type = XS_TAG_IF; } - $str = $this->compile_tag_if($params_str, $keyword_type == XS_TAG_IF ? false : true); + $str = $this->compile_tag_if($params_str, $keyword_type != XS_TAG_IF); if ($str) { $compiled[] = ''; if ($keyword_type == XS_TAG_IF) {