sizeof => count

This commit is contained in:
fbsanchez 2022-01-19 12:40:52 +01:00
parent d2d11588fb
commit 28743dcb5d
7 changed files with 9 additions and 9 deletions

View File

@ -27,7 +27,7 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
// Header
ui_print_page_header(__('Extensions').' » '.__('Defined extensions'), 'images/extensions.png', false, '', true, '');
if (sizeof($config['extensions']) == 0) {
if (count($config['extensions']) == 0) {
$extensions = extensions_get_extension_info();
if (empty($extensions)) {
echo '<h3>'.__('There are no extensions defined').'</h3>';

View File

@ -16725,7 +16725,7 @@ function api_get_traps($thrash1, $thrash2, $other, $returnType)
$sql .= ' and status = 0';
}
if (sizeof($other['data']) == 0) {
if (count($other['data']) == 0) {
$sql = 'SELECT * from ttrap';
}

View File

@ -441,7 +441,7 @@ function print_snmp_tags_active_filters($filter_resume=[])
$title = isset($filter_resume['title']) ? __('Active filter').' ('.$filter_resume['title'].')' : __('Active filters');
}
if (sizeof($filter_resume) > 0) {
if (count($filter_resume) > 0) {
ui_print_tags_view($title, $tags_set);
}
}

View File

@ -273,11 +273,11 @@ class ICal
$formatted = array();
foreach ($properties as $property) {
preg_match_all('~[^\r\n";]+(?:"[^"\\\]*(?:\\\.[^"\\\]*)*"[^\r\n";]*)*~', $property, $attributes); // Match semicolon separator outside of quoted substrings
$attributes = (sizeof($attributes) == 0) ? array($property) : reset($attributes); // Remove multi-dimensional array and use the first key
$attributes = (count($attributes) == 0) ? array($property) : reset($attributes); // Remove multi-dimensional array and use the first key
foreach ($attributes as $attribute) {
preg_match_all('~[^\r\n"=]+(?:"[^"\\\]*(?:\\\.[^"\\\]*)*"[^\r\n"=]*)*~', $attribute, $values); // Match equals sign separator outside of quoted substrings
$value = (sizeof($values) == 0) ? NULL : reset($values); // Remove multi-dimensional array and use the first key
$value = (count($values) == 0) ? NULL : reset($values); // Remove multi-dimensional array and use the first key
if (is_array($value) && isset($value[1])) {
$formatted[$value[0]] = trim($value[1], '"'); // Remove double quotes from beginning and end only
@ -598,7 +598,7 @@ class ICal
}
break;
$events = (isset($count_orig) && sizeof($events) > $count_orig) ? array_slice($events, 0, $count_orig) : $events; // Ensure we abide by COUNT if defined
$events = (isset($count_orig) && count($events) > $count_orig) ? array_slice($events, 0, $count_orig) : $events; // Ensure we abide by COUNT if defined
}
}
}

View File

@ -50,7 +50,7 @@ $is_mobile = true;
if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
$query = '';
if (sizeof($_REQUEST)) {
if (count($_REQUEST)) {
// Some (old) browsers don't like the ?&key=var
$query .= 'mobile/index.php?1=1';
}

View File

@ -24,7 +24,7 @@ ui_print_page_header(__('Reporting').' &raquo; '.__('Custom reporting'), 'image
$reports = reports_get_reports();
if (sizeof($reports) == 0) {
if (count($reports) == 0) {
echo "<div class='nf'>".__('There are no defined reportings').'</div>';
return;
}

View File

@ -290,7 +290,7 @@ $report = reporting_make_reporting_data(
$period,
'dinamic'
);
for ($i = 0; $i < sizeof($report['contents']); $i++) {
for ($i = 0; $i < count($report['contents']); $i++) {
$report['contents'][$i]['description'] = str_replace('&#x0d;&#x0a;', '<br/>', $report['contents'][$i]['description']);
}