Ignore:
Timestamp:
May 4, 2014 12:29:05 AM (10 years ago)
Author:
anonymous
Message:

Removed some legacy files. Improved use of array_key_exists.

File:
1 edited

Legend:

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

    r479 r480  
    211211        }
    212212
    213         if (array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
     213        if (isset($_SESSION['_cache'][$this->_ns]) && array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
    214214            $app->logMsg(sprintf('Retreiving %s from cache.', $key), LOG_DEBUG, __FILE__, __LINE__);
    215215            // Move the accessed cached datum to the top of the stack. Maybe somebody knows a better way to do this?
     
    240240        }
    241241
    242         return array_key_exists($key, $_SESSION['_cache'][$this->_ns]);
     242        return (isset($_SESSION['_cache'][$this->_ns]) && array_key_exists($key, $_SESSION['_cache'][$this->_ns]));
    243243    }
    244244
     
    251251    public function delete($key)
    252252    {
    253         if (array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
     253        if (isset($_SESSION['_cache'][$this->_ns]) && array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
    254254            unset($_SESSION['_cache'][$this->_ns][$key]);
    255255            return true;
Note: See TracChangeset for help on using the changeset viewer.