Changeset 579 for trunk/lib


Ignore:
Timestamp:
Feb 27, 2017 2:21:45 PM (7 years ago)
Author:
anonymous
Message:

Check before retreiving cookie value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Prefs.inc.php

    r548 r579  
    328328            } else {
    329329                $app->logMsg(sprintf('Key not found in prefs cache: %s', $key), LOG_DEBUG, __FILE__, __LINE__);
    330                 return null;
    331             }
    332             break;
     330            }
     331            return null;
    333332
    334333        case 'cookie':
    335334            $name = $this->_getCookieName($key);
    336             if ($this->exists($key)) {
     335            if ($this->exists($key) && '' != $_COOKIE[$name]) {
    337336                $val = json_decode($_COOKIE[$name], true);
    338337                $app->logMsg(sprintf('Found %s in cookie: %s', $key, getDump($val)), LOG_DEBUG, __FILE__, __LINE__);
    339338                return $val;
    340339            } else {
    341                 $app->logMsg(sprintf('Key not found in cookie: %s', $key), LOG_DEBUG, __FILE__, __LINE__);
    342                 return null;
    343             }
    344             break;
     340                $app->logMsg(sprintf('Did not find %s in cookie', $key), LOG_DEBUG, __FILE__, __LINE__);
     341            }
     342            return null;
    345343        }
    346344    }
Note: See TracChangeset for help on using the changeset viewer.