mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-21 16:01:40 +02:00
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
This commit is contained in:
@@ -133,7 +133,7 @@ class base
|
||||
{
|
||||
global $cache, $config, $db, $user;
|
||||
|
||||
$length = min(sizeof($id_ary), $config['search_block_size']);
|
||||
$length = min(count($id_ary), $config['search_block_size']);
|
||||
|
||||
// nothing to cache so exit
|
||||
if (!$length)
|
||||
@@ -148,7 +148,7 @@ class base
|
||||
if (!($store = $cache->get('_search_results_' . $search_key)))
|
||||
{
|
||||
// add the current keywords to the recent searches in the cache which are listed on the search page
|
||||
if (!empty($keywords) || sizeof($author_ary))
|
||||
if (!empty($keywords) || count($author_ary))
|
||||
{
|
||||
$sql = 'SELECT search_time
|
||||
FROM ' . SEARCH_RESULTS_TABLE . '
|
||||
@@ -201,7 +201,7 @@ class base
|
||||
$store += $store_ids;
|
||||
|
||||
// if the cache is too big
|
||||
if (sizeof($store) - 2 > 20 * $config['search_block_size'])
|
||||
if (count($store) - 2 > 20 * $config['search_block_size'])
|
||||
{
|
||||
// remove everything in front of two blocks in front of the current start index
|
||||
for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++)
|
||||
@@ -243,7 +243,7 @@ class base
|
||||
global $db, $cache, $config;
|
||||
|
||||
// clear all searches that searched for the specified words
|
||||
if (sizeof($words))
|
||||
if (count($words))
|
||||
{
|
||||
$sql_where = '';
|
||||
foreach ($words as $word)
|
||||
@@ -264,7 +264,7 @@ class base
|
||||
}
|
||||
|
||||
// clear all searches that searched for the specified authors
|
||||
if (is_array($authors) && sizeof($authors))
|
||||
if (is_array($authors) && count($authors))
|
||||
{
|
||||
$sql_where = '';
|
||||
foreach ($authors as $author)
|
||||
|
Reference in New Issue
Block a user