From 36a4f8a2d253207c21b8df627171d697203209c9 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 16 Jul 2006 05:12:27 +0000 Subject: [PATCH] r888: Changing all count() calls to be sizeof() --- admin/autoaction.php | 2 +- admin/field.php | 2 +- editreport.php | 2 +- includes/class_message_reporter.php | 4 ++-- includes/functions.php | 4 ++-- includes/functions_product.php | 2 +- search.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/autoaction.php b/admin/autoaction.php index ae7ac4d..638c434 100644 --- a/admin/autoaction.php +++ b/admin/autoaction.php @@ -89,7 +89,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update') } } - if (count($deltas['custom']) < 1 AND count($deltas['builtin']) < 1) + if (sizeof($deltas['custom']) < 1 AND sizeof($deltas['builtin']) < 1) { $admin->error($lang->string('You need to specify some fields to change.')); } diff --git a/admin/field.php b/admin/field.php index f9b2f5a..62020c9 100644 --- a/admin/field.php +++ b/admin/field.php @@ -133,7 +133,7 @@ if ($_REQUEST['do'] == 'update') // so we have to use preg_split with the PREG_SPLIT_NO_EMPTY flag to prevent this $selects = preg_split("#\n#", trim($bugsys->in['selects']), 0, PREG_SPLIT_NO_EMPTY); array_walk($selects, 'trim'); - if (count($selects) < 1) + if (sizeof($selects) < 1) { $admin->error($lang->string('You need to specify some select values.')); } diff --git a/editreport.php b/editreport.php index cc689b5..63de8ac 100644 --- a/editreport.php +++ b/editreport.php @@ -111,7 +111,7 @@ if ($_POST['do'] == 'update') $pcv = parse_pcv_select($bugsys->in['pcv_select'], true); $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); - $dependencies = ((count($dependencies) < 1) ? '' : implode(', ', $dependencies)); + $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); $bugapi->set('summary', $bugsys->in['summary']); $bugapi->set('severity', $bugsys->in['severity']); diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index f5fda21..7c7c5a3 100755 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -68,7 +68,7 @@ class Message_Reporter global $bugsys; global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - if (count($this->items) > 0 AND empty($this->process)) + if (sizeof($this->items) > 0 AND empty($this->process)) { trigger_error('Message_Reporter->items is an array so please use Message_Reporter->error_list_process() to prepare it', E_USER_ERROR); } @@ -86,7 +86,7 @@ class Message_Reporter */ function error_list_process() { - if (!is_array($this->items) OR count($this->items) < 1) + if (!is_array($this->items) OR sizeof($this->items) < 1) { return; } diff --git a/includes/functions.php b/includes/functions.php index 1d30420..e01d4e0 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -354,7 +354,7 @@ function process_custom_fields($bugid, $inputdata = array()) return $errorlist; } - if (count($fieldbuild) < 1) + if (sizeof($fieldbuild) < 1) { return; } @@ -405,7 +405,7 @@ function fetch_on_bits($mask, $userinfo = null) } } - if (count($onbits) < 1) + if (sizeof($onbits) < 1) { $onbits = array(0); } diff --git a/includes/functions_product.php b/includes/functions_product.php index cbad941..4adf6ad 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -186,7 +186,7 @@ function parse_pcv_select($input, $validate = false) } $trio = preg_split('#(p|c|v)#i', $input, -1, PREG_SPLIT_NO_EMPTY); - if (count($trio) != 3) + if (sizeof($trio) != 3) { return false; } diff --git a/search.php b/search.php index 6a2376e..5de5eca 100644 --- a/search.php +++ b/search.php @@ -238,7 +238,7 @@ if ($_REQUEST['do'] == 'process') // ------------------------------------------------------------------- // have to search something - if (count($querybuild) < 1) + if (sizeof($querybuild) < 1) { $message->error(sprintf($lang->string('You have to enter some criteria to search for. Node that words less than %1$d characters are ignored by the search engine (and some other very common words, too).'), SEARCH_WORD_MIN)); } -- 2.22.5