converting if ($foo != "") to if ($foo)

This commit is contained in:
dogmatic69 2012-09-21 23:34:37 +01:00
parent 8dc4de5de8
commit 36314e6d37
3 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);