aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-01-08 21:46:43 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-01-08 21:46:43 +0100
commitcb08bf3c0cac1f15ae46238a00a56ff7bf72efda (patch)
tree493079bd331595f46508a9184b2af775f17acff2
parent9e001153d6a64a90353207c4da8b01329f8e39e5 (diff)
downloadforums-cb08bf3c0cac1f15ae46238a00a56ff7bf72efda.tar
forums-cb08bf3c0cac1f15ae46238a00a56ff7bf72efda.tar.gz
forums-cb08bf3c0cac1f15ae46238a00a56ff7bf72efda.tar.bz2
forums-cb08bf3c0cac1f15ae46238a00a56ff7bf72efda.tar.xz
forums-cb08bf3c0cac1f15ae46238a00a56ff7bf72efda.zip
[feature/avatars] Strictly check if avatar list is empty and cache result
PHPBB3-10018
-rw-r--r--phpBB/includes/avatar/driver/local.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/includes/avatar/driver/local.php b/phpBB/includes/avatar/driver/local.php
index f82c9a6c74..b96b602f85 100644
--- a/phpBB/includes/avatar/driver/local.php
+++ b/phpBB/includes/avatar/driver/local.php
@@ -142,6 +142,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
/**
* Get a list of avatars that are locally available
+ * Results get cached for 24 hours (86400 seconds)
*
* @return array Array containing the locally available avatars
*/
@@ -149,7 +150,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
{
$avatar_list = ($this->cache == null) ? false : $this->cache->get('avatar_local_list');
- if (!$avatar_list)
+ if ($avatar_list === false)
{
$avatar_list = array();
$path = $this->phpbb_root_path . $this->config['avatar_gallery_path'];
@@ -185,7 +186,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
if ($this->cache != null)
{
- $this->cache->put('avatar_local_list', $avatar_list);
+ $this->cache->put('avatar_local_list', $avatar_list, 86400);
}
}