From 36314e6d37cf954e207d183f15705aecd85e55fe Mon Sep 17 00:00:00 2001 From: dogmatic69 Date: Fri, 21 Sep 2012 23:34:37 +0100 Subject: [PATCH] converting if ($foo != "") to if ($foo) --- lib/Cake/Model/Datasource/CakeSession.php | 2 +- lib/Cake/View/Helper.php | 2 +- lib/Cake/View/Helper/CacheHelper.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index 4c0ff34a3..3161066cf 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -663,7 +663,7 @@ class CakeSession { */ public static function renew() { if (session_id()) { - if (session_id() != '' || isset($_COOKIE[session_name()])) { + if (session_id() || isset($_COOKIE[session_name()])) { setcookie(Configure::read('Session.cookie'), '', time() - 42000, self::$path); } session_regenerate_id(true); diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index d9296f09a..ce597d52b 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -749,7 +749,7 @@ class Helper extends Object { * @return array Array of options with $key set. */ public function addClass($options = array(), $class = null, $key = 'class') { - if (isset($options[$key]) && trim($options[$key]) != '') { + if (isset($options[$key]) && trim($options[$key])) { $options[$key] .= ' ' . $class; } else { $options[$key] = $class; diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index c6328b72b..d4d40c376 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -148,7 +148,7 @@ class CacheHelper extends AppHelper { $cacheTime = $cacheAction; } - if ($cacheTime != '' && $cacheTime > 0) { + if ($cacheTime && $cacheTime > 0) { $cached = $this->_parseOutput($out); try { $this->_writeFile($cached, $cacheTime, $useCallbacks);