Skip to content

Commit

Permalink
converting if ($foo != "") to if ($foo)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Sep 21, 2012
1 parent 8dc4de5 commit 36314e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/CakeSession.php
Expand Up @@ -663,7 +663,7 @@ protected static function _checkValid() {
*/
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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper.php
Expand Up @@ -749,7 +749,7 @@ protected function _initInputField($field, $options = array()) {
* @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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/CacheHelper.php
Expand Up @@ -148,7 +148,7 @@ public function cache($file, $out) {
$cacheTime = $cacheAction;
}

if ($cacheTime != '' && $cacheTime > 0) {
if ($cacheTime && $cacheTime > 0) {
$cached = $this->_parseOutput($out);
try {
$this->_writeFile($cached, $cacheTime, $useCallbacks);
Expand Down

0 comments on commit 36314e6

Please sign in to comment.