From 975da3271dd7feddfd392a33adcd55d0022196eb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 6 Apr 2016 11:53:53 +0200 Subject: [PATCH] Properly supporting cache indices with NULL values --- .../cache/builder/AbstractCacheBuilder.class.php | 10 +++++----- .../lib/system/cache/builder/ICacheBuilder.class.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php index a55931e7d8..b054b3c48a 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php @@ -8,7 +8,7 @@ use wcf\system\SingletonFactory; * Default implementation for cache builders. * * @author Alexander Ebert - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.cache.builder @@ -28,7 +28,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu protected $maxLifetime = 0; /** - * @see \wcf\system\cache\builder\ICacheBuilder::getData() + * @inheritDoc */ public function getData(array $parameters = array(), $arrayIndex = '') { $index = CacheHandler::getInstance()->getCacheIndex($parameters); @@ -45,7 +45,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu } if (!empty($arrayIndex)) { - if (!isset($this->cache[$index][$arrayIndex])) { + if (!array_key_exists($arrayIndex, $this->cache[$index])) { throw new SystemException("array index '".$arrayIndex."' does not exist in cache resource"); } @@ -56,14 +56,14 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu } /** - * @see \wcf\system\cache\builder\ICacheBuilder::getMaxLifetime() + * @inheritDoc */ public function getMaxLifetime() { return $this->maxLifetime; } /** - * @see \wcf\system\cache\builder\ICacheBuilder::reset() + * @inheritDoc */ public function reset(array $parameters = array()) { CacheHandler::getInstance()->flush($this, $parameters); diff --git a/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php index ae173709e6..1d0ac2843f 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php @@ -5,7 +5,7 @@ namespace wcf\system\cache\builder; * A cache builder provides data for the cache handler that ought to be cached. * * @author Alexander Ebert - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.cache.builder @@ -17,7 +17,7 @@ interface ICacheBuilder { * * @param array $parameters * @param string $arrayIndex - * @return array + * @return mixed */ public function getData(array $parameters = array(), $arrayIndex = ''); -- 2.20.1