From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- phpBB/phpbb/cache/driver/memory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/cache/driver/memory.php') diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index cc03804705..052f40c243 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -188,7 +188,7 @@ abstract class memory extends \phpbb\cache\driver\base } else { - if (!sizeof($this->vars)) + if (!count($this->vars)) { $this->load(); } -- cgit v1.2.1 From c7631635fa738f4c7df45f6f671d2eb47f2f72a3 Mon Sep 17 00:00:00 2001 From: hubaishan Date: Sun, 16 Sep 2018 06:38:58 +0300 Subject: [ticket/15791] php 7.2 count() bug in memory cache driver function `_read` in classes inherted from `memory` may returns `false` but `$vars` must be an array PHPBB3-15791 --- phpBB/phpbb/cache/driver/memory.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/cache/driver/memory.php') diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 052f40c243..eba9549877 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -51,10 +51,11 @@ abstract class memory extends \phpbb\cache\driver\base function load() { // grab the global cache - $this->vars = $this->_read('global'); + $data = $this->_read('global'); - if ($this->vars !== false) + if ($data !== false) { + $this->vars = $data; return true; } -- cgit v1.2.1