From 27e6b186e667c55eb097de7c4910aaa7f3465989 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 16 Sep 2022 15:49:42 +0200 Subject: [PATCH] Continued: - updated a lot old `array()` to "new" `[]` way (yes, this project is slow) - updated .gitattributes and therefore some files have "changed" --- .gitattributes | 6 +- birthday_confirm.php | 2 +- contrib/ext-partner/earnstar-datenimport.pdf | Bin 107979 -> 107978 bytes .../mt_konverter/mt_mxchange_converter.php | 4 +- img/captcha-error.png | Bin 7477 -> 7476 bytes .../politiker-stopp-print-kopf.png | Bin 6266 -> 6265 bytes .../politiker-stopp_150x24.png | Bin 2208 -> 2207 bytes inc/ajax/ajax_installer.php | 6 +- inc/callback-functions.php | 50 ++++++++-------- inc/captcha-base.png | Bin 5441 -> 5440 bytes inc/classes/cachesystem.class.php | 12 ++-- inc/config-functions.php | 6 +- inc/database-functions.php | 38 ++++++------ inc/email-functions.php | 2 +- inc/extensions-functions.php | 20 +++---- inc/extensions/ext-wernis.php | 2 +- inc/filter-functions.php | 6 +- inc/filter/beg_filter.php | 2 +- inc/filter/bonus_filter.php | 2 +- inc/filter/doubler_filter.php | 2 +- inc/filters.php | 4 +- inc/fixes/fix_menu.php | 2 +- inc/general-functions.php | 30 +++++----- inc/http-functions.php | 22 +++---- inc/inc-functions.php | 4 +- inc/install-functions.php | 10 ++-- inc/install-inc.php | 4 +- inc/language-functions.php | 8 +-- inc/libs/admins_functions.php | 2 +- inc/libs/bonus_functions.php | 2 +- inc/libs/forced_functions.php | 16 ++--- inc/libs/grade_functions.php | 10 ++-- inc/libs/html_mail_functions.php | 2 +- inc/libs/network_functions.php | 56 +++++++++--------- inc/libs/newsletter_functions.php | 2 +- inc/libs/optimize_functions.php | 4 +- inc/libs/rallye_functions.php | 26 ++++---- inc/libs/refback_functions.php | 6 +- inc/libs/sponsor_functions.php | 10 ++-- inc/libs/surfbar_functions.php | 24 ++++---- inc/libs/task_functions.php | 8 +-- inc/libs/theme_functions.php | 4 +- inc/libs/transaction_functions.php | 6 +- inc/libs/user_functions.php | 2 +- inc/libs/wernis_functions.php | 14 ++--- inc/libs/yoomedia_functions.php | 8 +-- inc/load_cache.php | 2 +- inc/loader/load-admins.php | 4 +- inc/loader/load-extension.php | 4 +- inc/loader/load-payments.php | 2 +- inc/loader/load-points_data.php | 2 +- inc/loader/load-themes.php | 2 +- inc/mails/beg_mails.php | 2 +- inc/mails/bonus_mails.php | 2 +- inc/modules/admin/admin-inc.php | 26 ++++---- inc/modules/admin/what-admin_add.php | 12 ++-- inc/modules/admin/what-admins_edit.php | 2 +- inc/modules/admin/what-config_bonus.php | 2 +- inc/modules/admin/what-config_rewrite.php | 2 +- inc/modules/admin/what-config_secure.php | 2 +- inc/modules/admin/what-guest_add.php | 8 +-- inc/modules/admin/what-list_autopurge.php | 2 +- inc/modules/admin/what-list_bank_package.php | 12 ++-- .../what-list_network_array_translation.php | 2 +- .../what-list_network_request_params.php | 2 +- inc/modules/admin/what-list_network_types.php | 2 +- inc/modules/admin/what-list_notifications.php | 2 +- inc/modules/admin/what-list_user_amounts.php | 2 +- inc/modules/admin/what-mem_add.php | 12 ++-- inc/modules/admin/what-repair_amnu.php | 2 +- inc/modules/admin/what-repair_gmnu.php | 2 +- inc/modules/admin/what-repair_mmnu.php | 2 +- inc/modules/admin/what-send_coupon.php | 2 +- inc/modules/admin/what-theme_import.php | 12 ++-- inc/modules/guest/what-sponsor_reg.php | 2 +- inc/modules/guest/what-stats.php | 4 +- inc/modules/guest/what-top10.php | 2 +- inc/modules/member/what-holiday.php | 2 +- inc/modules/member/what-mydata.php | 2 +- inc/modules/member/what-order.php | 10 ++-- inc/modules/member/what-stats.php | 2 +- inc/modules/member/what-themes.php | 12 ++-- inc/modules/member/what-unconfirmed.php | 2 +- inc/modules/member/what-wernis.php | 3 +- inc/phpmailer/examples/images/phpmailer.png | Bin 3506 -> 3505 bytes inc/phpmailer/test/test.png | Bin 1280 -> 1279 bytes inc/pool-functions.php | 2 +- inc/pool/pool-bonus.php | 2 +- inc/purge/purge-coupon.php | 2 +- inc/purge/purge-inact.php | 6 +- inc/purge/purge-tasks.php | 2 +- inc/referral-functions.php | 18 +++--- inc/sql-functions.php | 4 +- inc/stats-functions.php | 2 +- inc/template-functions.php | 16 ++--- inc/wrapper-functions.php | 12 ++-- inc/xml-functions.php | 10 ++-- theme/business/images/code_bg.png | Bin 2055 -> 2054 bytes theme/default/images/code_bg.png | Bin 2055 -> 2054 bytes theme/desert/images/code_bg.png | Bin 2055 -> 2054 bytes theme/desert/images/help/bullet.png | Bin 954 -> 953 bytes theme/org/images/code_bg.png | Bin 2055 -> 2054 bytes theme/schleuder/images/code_bg.png | Bin 2055 -> 2054 bytes theme/schleuder/images/help/bullet.png | Bin 954 -> 953 bytes .../images/menu/menu_title_online.jpg | Bin 5202 -> 5201 bytes 105 files changed, 347 insertions(+), 346 deletions(-) diff --git a/.gitattributes b/.gitattributes index 983348db6d..c322e6e905 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,9 +4,6 @@ # Autodetect text files * text=auto -# Force the following filetypes to have unix eols, so Windows does not break them -*.* text eol=lf - # Force images/fonts to be handled as binaries *.jpg filter=lfs diff=lfs merge=lfs -text *.jpeg filter=lfs diff=lfs merge=lfs -text @@ -31,3 +28,6 @@ *.otf filter=lfs diff=lfs merge=lfs -text *.z filter=lfs diff=lfs merge=lfs -text *.docx filter=lfs diff=lfs merge=lfs -text + +# Force the following filetypes to have unix eols, so Windows does not break them +*.* text eol=lf diff --git a/birthday_confirm.php b/birthday_confirm.php index 30a21421eb..80f2b95c74 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -81,7 +81,7 @@ LIMIT 1", //* DEBUG: */ debugOutput("userid=".$userid.",chk=".$chk." (".strlen($chk).'/'.strlen(getRequestElement('check')).'/'.sqlNumRows($result) . ')'); // Prepare content -$content = array(); +$content = []; // Is an entry there? if (sqlNumRows($result) == 1) { diff --git a/contrib/ext-partner/earnstar-datenimport.pdf b/contrib/ext-partner/earnstar-datenimport.pdf index c4cd4a56b91452304a7767be49f733f449a6dbd0..0ed92c6dc4d71296898824ab333b20ac3f1f442c 100644 GIT binary patch delta 22 ecmX?on(fqSwhi~1CU2-0Y5v@_{c{uJ4J81Q3Jg5} delta 24 gcmX?gn(g#ywhi~17$value) { if ((intval($key) == "0") && ($key != "0")) { switch ($key) { diff --git a/img/captcha-error.png b/img/captcha-error.png index ab0a996a46fbaebca87ec326d93b052ffb006f20..dc6ea8c5a5dd23a2ded18c9717802620c1a4cfaf 100644 GIT binary patch delta 13 UcmdmLwZ)31Gr-S%BddWd03#U$Qvd(} delta 14 VcmdmDwbhEXGr-TCcO#2|EC4321YiIF diff --git a/img/politician-stop/politiker-stopp-print-kopf.png b/img/politician-stop/politiker-stopp-print-kopf.png index 483e6831fcca7ddc80b625b00b54aba2251b4af9..aefc5ff641b4f47f67f9cdb72753506d8e40b5e5 100644 GIT binary patch delta 13 Ucmexm@Y8^$Gr-S%BWtMy04X{J2><{9 delta 14 Vcmexq@XLU;Gr-TCcOy%w1OP2Y1r`7R diff --git a/img/politician-stop/politiker-stopp_150x24.png b/img/politician-stop/politiker-stopp_150x24.png index 4f92ce95bff0f510c670304541883dc46206df3c..35c1ddcf942858626b42409a14878b1f564046d6 100644 GIT binary patch delta 13 UcmZ1=IA4&ZGr-S%BkODq03KWfEdT%j delta 14 VcmbO)xImD#Gr-TCcO%Pe4geu`1Udi! diff --git a/inc/ajax/ajax_installer.php b/inc/ajax/ajax_installer.php index 77cc42b8f2..bb418ea129 100644 --- a/inc/ajax/ajax_installer.php +++ b/inc/ajax/ajax_installer.php @@ -137,7 +137,7 @@ function doAjaxInstallerFooterNavigation () { } // END - if // Init array for footer navigation - $enabledNavigations = array(); + $enabledNavigations = []; // "Detect" the 'tab' value switch (postRequestElement('tab')) { @@ -305,7 +305,7 @@ function doAjaxInstallerSaveChanges () { 'message' => '{--INSTALLER_SAVE_CHANGES_FAILED--}', // Don't set this to false, or else it will be returned as 'failed' but is saved 'is_saved' => TRUE, - 'failed_fields' => array() + 'failed_fields' => [] ); // Init overall status @@ -532,7 +532,7 @@ function doAjaxPrepareInstallerOverview () { // Don't set this to false, or else it will be returned as 'failed' but is saved 'is_valid' => TRUE, // Failed fields - 'failed_fields' => array() + 'failed_fields' => [] ); // Init overall status and final output diff --git a/inc/callback-functions.php b/inc/callback-functions.php index 9ce22d67cf..29e45644cd 100644 --- a/inc/callback-functions.php +++ b/inc/callback-functions.php @@ -76,7 +76,7 @@ function doXmlCallbackFunction ($resource, $attributes) { // Add the function name and no attributes by default $GLOBALS['__XML_CALLBACKS']['callbacks'][] = __FUNCTION__; $GLOBALS['__XML_CALLBACKS']['functions'][__FUNCTION__][] = $attributes['VALUE']; - $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = array(); + $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = []; $GLOBALS['__COLUMN_INDEX'][__FUNCTION__] = 'column'; } @@ -119,7 +119,7 @@ function doXmlDatabaseColumnList ($resource, $attributes) { } // END - if // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = []; } // Handles the XML node 'database-column-list-entry' @@ -173,7 +173,7 @@ function doXmlCallbackFunctionList ($resource, $attributes) { } // END - if // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = []; } // Handles the XML node 'callback-function-list-entry' @@ -215,7 +215,7 @@ function doXmlExtraParameterList ($resource, $attributes) { } // END - if // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = []; } // Handles the XML node 'extra-parameter-list-entry' @@ -257,7 +257,7 @@ function doXmlTimeColumnsList ($resource, $attributes) { } // END - if // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'] = []; } // Handles the XML node 'time-columns-list-entry' @@ -527,7 +527,7 @@ function doXmlStatusChangeColumn ($resource, $attributes) { } // Add the entry to the list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = []; } // Handles the XML node 'status-change-list' @@ -542,7 +542,7 @@ function doXmlStatusChangeList ($resource, $attributes) { } // Add the entry to the list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = []; } // Handles the XML node 'status-change-list-entry' @@ -789,7 +789,7 @@ function doXmlDataTable ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'] = []; // Add the entry to the array addXmlValueToCallbackAttributes('data_table', $attributes); @@ -818,7 +818,7 @@ function doXmlTableJoinType ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'] = []; // Add the entry to the array addXmlValueToCallbackAttributes('table_join_type', $attributes); @@ -841,7 +841,7 @@ function doXmlTableJoinName ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'] = []; // Add the entry to the array addXmlValueToCallbackAttributes('table_join_name', $attributes); @@ -882,7 +882,7 @@ function doXmlJoinOnLeftTable ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'] = []; // Add the entry to the array addXmlValueToCallbackAttributes('join_on_left_table', $attributes); @@ -914,7 +914,7 @@ function doXmlJoinOnRightTable ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'] = []; // Add the entry to the array addXmlValueToCallbackAttributes('join_on_right_table', $attributes); @@ -943,7 +943,7 @@ function doXmlJoinOnCondition ($resource, $attributes) { } // Init array - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'] = []; // Add the entry to the array //die('
'.print_r($attributes,true).'
'); @@ -962,7 +962,7 @@ function doXmlSelectDataFromList ($resource, $attributes) { } // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = []; } // Handles the XML node 'select-data-from-list-entry' @@ -1016,7 +1016,7 @@ function doXmlWhereSelectFromList ($resource, $attributes) { } // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = []; } // Handles the XML node 'where-select-from-list-entry' @@ -1106,7 +1106,7 @@ function doXmlOrderByList ($resource, $attributes) { } // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = []; } // Handles the XML node 'order-by-list-entry' @@ -1214,7 +1214,7 @@ function doXmlColumnCallbackList ($resource, $attributes) { } // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = []; } // Handles the XML node 'column-callback-list-entry' @@ -1277,7 +1277,7 @@ function doXmlCallbackExtraParameterList ($resource, $attributes) { } // Add an empty list - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = []; } // Handles the XML node 'callback-extra-parameter-list-entry' @@ -1405,7 +1405,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', if ((isset($attributes['TYPE'])) && ($attributes['TYPE'] == 'array')) { // Another nested array //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element); - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = []; } elseif (!empty($extraKey)) { // Sub-array (one level only) //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...'); @@ -1413,7 +1413,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', // Numerical index //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])] = $attributes['VALUE']; } elseif (!empty($key)) { @@ -1448,7 +1448,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', // Add the entry //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS'] . ',FUNCTION[' . gettype($attributes['FUNCTION']) . ']=' . $attributes['FUNCTION'] . ' - FUNCTION! (VALUE=' . $attributes['VALUE'] . ')'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; } elseif ((isset($attributes['NAME'])) && (isset($attributes['ALIAS']))) { @@ -1479,7 +1479,7 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',LOOK-FOR[' . gettype($attributes['LOOK-FOR']) . ']=' . $attributes['LOOK-FOR'] . ' - CONDITION! (VALUE=' . $attributes['VALUE'] . ')'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array; } elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) { @@ -1511,21 +1511,21 @@ function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', // COLUMN/VALUE detected //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN/VALUE!'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE']; } elseif ((isset($attributes['COLUMN'])) && (isset($attributes['DATA']))) { // COLUMN/DATA detected //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',DATA[' . gettype($attributes['DATA']) . ']=' . $attributes['DATA'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN/DATA!'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE']; } elseif (((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) && (isset($attributes['VALUE']))) { // Numerical index //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!'); if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) { - $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array(); + $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = []; } // END - if $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['VALUE']; } elseif ((count($attributes) == 1) && (isset($attributes['TYPE']))) { diff --git a/inc/captcha-base.png b/inc/captcha-base.png index f29f083766dc8a4ec9a26eab69d81f391aa117d7..3346b4558f8b0ae662cee063d3c69a4a03c23820 100644 GIT binary patch delta 13 UcmX@8bwG=yGr-S%Bdd)l03zuGPXGV_ delta 14 VcmX@0bx@17Gr-TCcO#39C;%pR1Y7_B diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index c9dcc71a44..deeba2fc8e 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -47,19 +47,19 @@ class CacheSystem { public $pointer = FALSE; // Data array from cache - public $data = array(); + public $data = []; // Version data from cache - public $version = array(); + public $version = []; // Cache name public $name = ''; - public $rebuilt = array(); + public $rebuilt = []; // File extension public $extension = ''; - public $status = array(); - public $readable = array(); + public $status = []; + public $readable = []; public $fullPath = ''; // Constructor @@ -304,7 +304,7 @@ class CacheSystem { } // Always return an empty array if we have trouble or no data - return array(); + return []; } // Destroy an existing cache file diff --git a/inc/config-functions.php b/inc/config-functions.php index 825faea0d8..fd11c3e024 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -128,7 +128,7 @@ function isConfigurationLoaded () { // Getter for whole $GLOBALS['config'] array function getConfigArray () { // Default is null - $return = array(); + $return = []; // Is the config set? if (isset($GLOBALS['config'])) { @@ -194,7 +194,7 @@ function updateOldConfigFile () { $oldConfig = explode(PHP_EOL, readFromFile(getPath() . 'inc/config.php')); // Now, analyze every entry - $done = array(); + $done = []; foreach ($oldConfig as $line) { // Check all watch lines foreach ($watchLines as $old => $new) { @@ -446,7 +446,7 @@ function getSelectedConfig ($configEntries) { // "Getter" for configuration entries function getConfigEntries ($configEntries, $value) { // Init content - $content = array(); + $content = []; // "Walk" through all entries foreach ($configEntries as $entry) { diff --git a/inc/database-functions.php b/inc/database-functions.php index c299781427..a9f000fd5a 100644 --- a/inc/database-functions.php +++ b/inc/database-functions.php @@ -402,7 +402,7 @@ function isMember () { // Fix missing 'last_online' array, damn stupid code :((( // @TODO Try to rewrite this to one or more functions if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) { - $GLOBALS['last_online'] = array(); + $GLOBALS['last_online'] = []; } // END - if // Is the cache entry there? @@ -1390,7 +1390,7 @@ function getAdminMenuMode ($adminId) { } // Generates an option list from various parameters -function generateOptions ($table, $key, $value, $default = '', $extra = '', $whereStatement = '', $disabled = array(), $callback = '', $allowNone = FALSE) { +function generateOptions ($table, $key, $value, $default = '', $extra = '', $whereStatement = '', $disabled = [], $callback = '', $allowNone = FALSE) { $ret = ''; // Allow none? @@ -1601,9 +1601,9 @@ function generateCategoryOptionsList ($mode, $userid = NULL) { // Initialize array... $categories = array( - 'id' => array(), - 'name' => array(), - 'userids' => array() + 'id' => [], + 'name' => [], + 'userids' => [] ); // Get categories @@ -1852,7 +1852,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) { // Are there entries? if (!ifSqlHasZeroNumRows($result)) { // Now load all userids for one big query! - $userids = array(); + $userids = []; while ($data = sqlFetchArray($result)) { // By default reduce and found no emails $num = 0; @@ -1941,7 +1941,7 @@ LIMIT 1", } // List all given joined rows (callback function from XML) -function doGenericJoinedListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $tableJoinType, $tableJoinName, $joinOnLeftTable, $joinOnCondition, $joinOnRightTable, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array(), $content = array()) { +function doGenericJoinedListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $tableJoinType, $tableJoinName, $joinOnLeftTable, $joinOnCondition, $joinOnRightTable, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = [], $conditions = [], $content = []) { // Verify that tableName and columns are not empty if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -1974,7 +1974,7 @@ function doGenericJoinedListEntries ($tableTemplate, $rowTemplate, $noEntryMessa } // List all given rows (callback function from XML) -function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array(), $content = array()) { +function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = [], $conditions = [], $content = []) { // Verify that tableName and columns are not empty if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -2004,7 +2004,7 @@ function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, } // Do the listing of entries -function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array(), $content = array()) { +function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = [], $content = []) { // Run the SQL query $result = sqlQuery($sql, __FUNCTION__, __LINE__); @@ -2026,7 +2026,7 @@ function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $ // Call the callback-function //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=
'.print_r($args, TRUE).'
'); - // @TODO If the EL sub-system can support more than one parameter, this call_user_func_array() can be avoided + // @TODO If the EL sub-system can support more than one parameter, this call_user_func_[] can be avoided $row[$columnName] = call_user_func_array($callbackName, $args); } // END - foreach @@ -2055,7 +2055,7 @@ function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $ } // Adds a given entry to the database -function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) { +function doGenericAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) { //* DEBUG: */ die(__FUNCTION__.':columns=
'.print_r($columns,TRUE).'
,filterFunctions=
'.print_r($filterFunctions,TRUE).'
,extraValues=
'.print_r($extraValues,TRUE).'
,timeColumns=
'.print_r($timeColumns,TRUE).'
,columnIndex=
'.print_r($columnIndex,TRUE).'
,POST=
'.print_r($_POST,TRUE).'
'); // Verify that tableName and columns are not empty if ((!is_array($tableName)) || (count($tableName) != 1)) { @@ -2067,8 +2067,8 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = } // Init columns and value elements - $sqlColumns = array(); - $sqlValues = array(); + $sqlColumns = []; + $sqlValues = []; // Default is that all went fine $GLOBALS['__XML_PARSE_RESULT'] = TRUE; @@ -2115,7 +2115,7 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = $search = key(search_array($columns, 'column', $columnName)); // Try to handle call-back functions and/or extra values on the list - //* DEBUG: */ outputHtml($key . '/' . $columnName . '=
'.print_r($columns,true).'
search_array()=
'.print_r(search_array($columns, 'column', $columnName), TRUE).'
'); + //* DEBUG: */ outputHtml($key . '/' . $columnName . '=
'.print_r($columns,true).'
search_[]=
'.print_r(search_array($columns, 'column', $columnName), TRUE).'
'); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '(' . gettype($key) . ')][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!'); if (is_string($key)) { // Key is a string @@ -2171,7 +2171,7 @@ function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = } // Edit rows by given id numbers -function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $subject = '') { +function doGenericEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $subject = '') { // Is there "time columns"? if (isFilledArray($timeColumns)) { // Then "walk" through all entries @@ -2188,7 +2188,7 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun $id = bigintval($id); // Prepare content array (new values) - $content = array(); + $content = []; // Prepare SQL for this row $sql = sprintf('UPDATE `{?_MYSQL_PREFIX?}_%s` SET', @@ -2312,7 +2312,7 @@ function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFun } // Delete rows by given id numbers -function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) { +function doGenericDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = []) { // The base SQL command: $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)"; @@ -2377,7 +2377,7 @@ function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterF // Build a special template list // @TODO cacheFiles is not yet supported -function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) { +function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) { // $tableName and $idColumn must bove be arrays! if ((!is_array($tableName)) || (count($tableName) != 1)) { // $tableName is no array @@ -2536,7 +2536,7 @@ ORDER BY ); // Init array - $rows = array(); + $rows = []; // Are there entries? if (!ifSqlHasZeroNumRows($result)) { diff --git a/inc/email-functions.php b/inc/email-functions.php index b6eb56173f..87eab21d5c 100644 --- a/inc/email-functions.php +++ b/inc/email-functions.php @@ -187,7 +187,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { } // Send notification to admin -function sendAdminNotification ($subject, $templateName, $content = array(), $userid = NULL) { +function sendAdminNotification ($subject, $templateName, $content = [], $userid = NULL) { if ((isExtensionInstalledAndNewer('admins', '0.4.1')) && (function_exists('sendAdminsEmails'))) { // Send new way //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName . ' - OKAY!'); diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index f4aac2d35b..fb579c1ec1 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -1165,7 +1165,7 @@ function determineTaskIdBySubject ($subject) { function addExtensionNotes ($ext_ver) { // Init notes/content $out = ''; - $content = array(); + $content = []; // Is do we have verbose output enabled? if ((!isExtensionActive('sql_patches')) || (isVerboseSqlEnabled())) { @@ -1213,7 +1213,7 @@ function addExtensionNotes ($ext_ver) { // Getter for CSS files array function getExtensionCssFiles () { // By default no additional CSS files are found - $cssFiles = array(); + $cssFiles = []; // Is the array there? if (isset($GLOBALS['css_files'])) { @@ -1228,7 +1228,7 @@ function getExtensionCssFiles () { // Init CSS files array function initExtensionCssFiles () { // Simply init it - $GLOBALS['css_files'] = array(); + $GLOBALS['css_files'] = []; } // Add new entry @@ -1312,7 +1312,7 @@ function addExtensionDependency ($updateDepends) { // Init array if ((!isset($GLOBALS['ext_running_updates'][getCurrentExtensionName()])) || (!is_array($GLOBALS['ext_running_updates'][getCurrentExtensionName()]))) { - $GLOBALS['ext_running_updates'][getCurrentExtensionName()] = array(); + $GLOBALS['ext_running_updates'][getCurrentExtensionName()] = []; } // END - if // Remember it in the list of running updates @@ -1345,7 +1345,7 @@ function initExtensionUpdateDependencies () { reportBug(__FUNCTION__, __LINE__, '() is called twice: currName=' . getCurrentExtensionName()); } // END - if - $GLOBALS['ext_update_depends'][getCurrentExtensionName()] = array(); + $GLOBALS['ext_update_depends'][getCurrentExtensionName()] = []; // Init running updates array initExtensionRuningUpdates(); @@ -1416,8 +1416,8 @@ function isExtensionUpdateRunning ($ext_name, $ignoreDependencies = FALSE) { function initExtensionRuningUpdates () { // Auto-init ext_running_updates if (!isset($GLOBALS['ext_running_updates'])) { - $GLOBALS['ext_running_updates'] = array(); - $GLOBALS['ext_register_running'] = array(); + $GLOBALS['ext_running_updates'] = []; + $GLOBALS['ext_register_running'] = []; } // END - if } @@ -1574,7 +1574,7 @@ function initExtensionSqls ($force = FALSE) { // Auto-init the array or if forced if (($force === TRUE) || (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()]))) { // Set the array - $GLOBALS['ext_sqls'][getCurrentExtensionName()] = array(); + $GLOBALS['ext_sqls'][getCurrentExtensionName()] = []; // Initialize the generic array initSqls(); @@ -1590,7 +1590,7 @@ function addExtensionSql ($sql) { // Is is the array there? if ((!isset($GLOBALS['ext_sqls'][$currentName][$currentVersion])) || (!is_array($GLOBALS['ext_sqls'][$currentName][$currentVersion]))) { // Init array - $GLOBALS['ext_sqls'][$currentName][$currentVersion] = array(); + $GLOBALS['ext_sqls'][$currentName][$currentVersion] = []; } // END - if // Is the SQL statement empty? @@ -1646,7 +1646,7 @@ function initExtensionRemovalList () { // Is the remove list there? if (!isset($GLOBALS['ext_update_remove'])) { // Then create it - $GLOBALS['ext_update_remove'] = array(); + $GLOBALS['ext_update_remove'] = []; } // END - if } diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index a276970de6..855fb48207 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -129,7 +129,7 @@ INDEX (`userid`)", case 'init': // Do stuff when extension is initialized // Init array - $GLOBALS['wernis_data'] = array(); + $GLOBALS['wernis_data'] = []; break; default: // Unknown extension mode diff --git a/inc/filter-functions.php b/inc/filter-functions.php index de21a6fd9c..b3d70a7eb5 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -366,9 +366,9 @@ function prepareFilterArray () { // Init dummy array $filterArray = array( - 'chains' => array(), - 'loaded' => array(), - 'counter' => array() + 'chains' => [], + 'loaded' => [], + 'counter' => [] ); // Found in cache so rewrite the array diff --git a/inc/filter/beg_filter.php b/inc/filter/beg_filter.php index 30d860e707..27ad157b0b 100644 --- a/inc/filter/beg_filter.php +++ b/inc/filter/beg_filter.php @@ -82,7 +82,7 @@ function FILTER_BEG_PURGE_IPS_NOTIFY_USER ($filterData) { } // Filter to add exclusion SQL for configured userid -function FILTER_EXCLUDE_BEG_USERID ($filterData = array()) { +function FILTER_EXCLUDE_BEG_USERID ($filterData = []) { // Is it valid? if (isValidId(getBegUserid())) { // Exclude it diff --git a/inc/filter/bonus_filter.php b/inc/filter/bonus_filter.php index 4a09b24491..9f605f576b 100644 --- a/inc/filter/bonus_filter.php +++ b/inc/filter/bonus_filter.php @@ -153,7 +153,7 @@ function FILTER_SEND_BONUS_NOTIFICATIONS ($filterData) { } // Filter to add exclusion SQL for configured userid -function FILTER_EXLCUDE_BONUS_USERID ($filterData = array()) { +function FILTER_EXLCUDE_BONUS_USERID ($filterData = []) { // Is it valid? if (isValidId(getBonusUserid())) { // Exclude it diff --git a/inc/filter/doubler_filter.php b/inc/filter/doubler_filter.php index 8ea9278486..d1c4e2ba4b 100644 --- a/inc/filter/doubler_filter.php +++ b/inc/filter/doubler_filter.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { } // END - if // Filter to add exclusion SQL for configured userid -function FILTER_EXLCUDE_DOUBLER_USERID ($filterData = array()) { +function FILTER_EXLCUDE_DOUBLER_USERID ($filterData = []) { // Is it valid? if (isValidId(getDoublerUserid())) { // Exclude it diff --git a/inc/filters.php b/inc/filters.php index 82fb319679..12e10ec5c1 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -293,7 +293,7 @@ function FILTER_RUN_SQLS ($filterData) { function FILTER_UPDATE_LOGIN_DATA () { // Add missing array if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) { - $GLOBALS['last_online'] = array(); + $GLOBALS['last_online'] = []; } // END - if // Recheck if logged in @@ -1416,7 +1416,7 @@ function FILTER_DETERMINE_MENU_MODE_GENERIC ($filterData) { } // Filter to exclude default referral id -function FILTER_EXCLUDE_DEFAULT_REFID ($filterData = array()) { +function FILTER_EXCLUDE_DEFAULT_REFID ($filterData = []) { // Is it valid? if (isValidId(getDefRefid())) { // Exclude it diff --git a/inc/fixes/fix_menu.php b/inc/fixes/fix_menu.php index 16a328be0c..1f968b60ad 100644 --- a/inc/fixes/fix_menu.php +++ b/inc/fixes/fix_menu.php @@ -42,7 +42,7 @@ foreach (array('guest','member','admin') as $menu) { array($menu), __FILE__, __LINE__); // Init array - $menus = array(); + $menus = []; // Load all entries while ($entry = sqlFetchArray($result)) { diff --git a/inc/general-functions.php b/inc/general-functions.php index 1fba1265d7..3520086ad3 100644 --- a/inc/general-functions.php +++ b/inc/general-functions.php @@ -97,7 +97,7 @@ function initApplication ($path) { // Loads additional libraries function loadLibraries () { // Init arrays - $__functions = array(); + $__functions = []; $__libs = array( 'stats', 'xml', @@ -146,7 +146,7 @@ function loadLibraries () { // Init fatal message array function initFatalMessages () { - $GLOBALS['fatal_messages'] = array(); + $GLOBALS['fatal_messages'] = []; } // Getter for whole fatal error messages @@ -189,7 +189,7 @@ function getTotalFatalErrors () { } // Generate a password in a specified length or use default password length -function generatePassword ($length = '0', $exclude = array()) { +function generatePassword ($length = '0', $exclude = []) { // Auto-fix invalid length of zero if ($length == '0') { $length = getMinPasswordLength(); @@ -1014,7 +1014,7 @@ function descrambleString ($str) { // Generated a "string" for scrambling function genScrambleString ($len) { // Prepare array for the numbers - $scrambleNumbers = array(); + $scrambleNumbers = []; // First we need to setup randomized numbers from 0 to 31 for ($idx = 0; $idx < $len; $idx++) { @@ -1171,7 +1171,7 @@ function debug_get_printable_backtrace () { foreach ($backtraceArray as $key => $trace) { if (!isset($trace['file'])) $trace['file'] = __FUNCTION__; if (!isset($trace['line'])) $trace['line'] = __LINE__; - if (!isset($trace['args'])) $trace['args'] = array(); + if (!isset($trace['args'])) $trace['args'] = []; $backtrace .= '
  • ' . basename($trace['file']) . ':' . $trace['line'] . ', ' . $trace['function'] . '(' . count($trace['args']) . ')
  • '; } // END - foreach @@ -1192,7 +1192,7 @@ function debug_get_mailable_backtrace () { foreach ($backtraceArray as $key => $trace) { if (!isset($trace['file'])) $trace['file'] = __FUNCTION__; if (!isset($trace['line'])) $trace['line'] = __LINE__; - if (!isset($trace['args'])) $trace['args'] = array(); + if (!isset($trace['args'])) $trace['args'] = []; $backtrace .= ($key+1) . '.:' . basename($trace['file']) . ':' . $trace['line'] . ', ' . $trace['function'] . '(' . count($trace['args']) . ")\n"; } // END - foreach @@ -1931,13 +1931,13 @@ function isExtraTitleSet () { * @param $withPrefixSuffix Whether to include prefix/suffix in found entries * @return $foundMatches All found positive matches for above criteria */ -function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $addBaseDir = TRUE, $excludeArray = array(), $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = TRUE, $suffix = '', $withPrefixSuffix = TRUE) { +function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $addBaseDir = TRUE, $excludeArray = [], $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = TRUE, $suffix = '', $withPrefixSuffix = TRUE) { // Add default entries we should always exclude array_unshift($excludeArray, '.', '..', '.svn', '.htaccess'); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ' - Entered!'); // Init found includes - $foundMatches = array(); + $foundMatches = []; // Open directory $dirPointer = opendir(getPath() . $baseDir) or reportBug(__FUNCTION__, __LINE__, 'Cannot read directory ' . basename($baseDir) . '.'); @@ -2423,7 +2423,7 @@ function replaceReturnNewLine ($str) { // explode(), but appending the delimiter again function stringToArray ($delimiter, $string) { // Init array - $strArray = array(); + $strArray = []; // "Walk" through all entries foreach (explode($delimiter, $string) as $split) { @@ -2453,7 +2453,7 @@ function detectMultiBytePrefix ($str) { // Searches given array for a sub-string match and returns all found keys in an array function getArrayKeysFromSubStrArray ($heystack, $needles, $offset = 0) { // Init array for all found keys - $keys = array(); + $keys = []; // Now check all entries foreach ($needles as $key => $needle) { @@ -2577,7 +2577,7 @@ function removeDoubleDotFromSubject ($subject) { } // Adds a given entry to the database -function memberAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) { +function memberAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) { // Is it a member? if (!isMember()) { // Then abort here @@ -2601,7 +2601,7 @@ function memberAddEntries ($tableName, $columns = array(), $filterFunctions = ar } // Edit rows by given id numbers -function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) { +function memberEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -2640,7 +2640,7 @@ function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFuncti } // Delete rows by given id numbers -function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) { +function memberDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) { // Do this only for members assert(isMember()); @@ -2683,7 +2683,7 @@ function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunc // Build a special template list // @TODO cacheFiles is not yet supported -function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) { +function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) { // Do this only for logged in member assert(isMember()); @@ -2766,7 +2766,7 @@ function getArrayFromArrayIndex ($array, $key) { assert(isset($array[0][$key])); // Init new array - $newArray = array(); + $newArray = []; // "Walk" through all elements foreach ($array as $element) { diff --git a/inc/http-functions.php b/inc/http-functions.php index acc3c6d5e6..0c040865ff 100644 --- a/inc/http-functions.php +++ b/inc/http-functions.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { // Initialize HTTP handling function initHttp () { // Initialize array - $GLOBALS['http_header'] = array(); + $GLOBALS['http_header'] = []; } // Sends out all headers required for HTTP/1.1 reply @@ -79,7 +79,7 @@ function isFullQualifiedUrl ($url) { } // Generates the full GET URL from given base URL and data array -function generateGetUrlFromBaseUrlData ($baseUrl, $requestData = array()) { +function generateGetUrlFromBaseUrlData ($baseUrl, $requestData = []) { // Init URL $getUrl = $baseUrl; @@ -139,9 +139,9 @@ function removeHttpHostNameFromUrl ($url) { } // Sends a HTTP request (GET, POST, HEAD are currently supported) -function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { +function sendHttpRequest ($requestType, $baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { // Init response - $response = array(); + $response = []; // Start "detecting" the request type switch ($requestType) { @@ -167,7 +167,7 @@ function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $remov } // Sends a HEAD request -function sendHttpHeadRequest ($baseUrl, $requestData = array(), $allowOnlyHttpOkay = TRUE) { +function sendHttpHeadRequest ($baseUrl, $requestData = [], $allowOnlyHttpOkay = TRUE) { // Generate full GET URL $getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getUrl=' . $getUrl); @@ -207,7 +207,7 @@ function sendHttpHeadRequest ($baseUrl, $requestData = array(), $allowOnlyHttpOk } // Send a GET request -function sendHttpGetRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { +function sendHttpGetRequest ($baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { // Generate full GET URL $getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData); //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getUrl=' . $getUrl); @@ -253,7 +253,7 @@ function sendHttpGetRequest ($baseUrl, $requestData = array(), $removeHeader = F } // Send a POST request, sometimes even POST requests have no parameters -function sendHttpPostRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { +function sendHttpPostRequest ($baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) { // Copy baseUrl to getUrl $getUrl = $baseUrl; @@ -316,7 +316,7 @@ function sendRawRequest ($host, $request, $allowOnlyHttpOkay = TRUE) { $port = 80; // Initialize array - $response = array(); + $response = []; // Default is non-broken HTTP server implementation $GLOBALS['is_http_server_broken'] = FALSE; @@ -590,7 +590,7 @@ function mergeHttpHeadersWithBody ($body) { // Removes HTTP header lines from a response array (e.g. output from sendRequest() ) function removeHttpHeaderFromResponse ($response) { // Save headers for later usage - $GLOBALS['http_headers'] = array(); + $GLOBALS['http_headers'] = []; // The first array element has to contain HTTP if ((isset($response[0])) && (substr(strtoupper($response[0]), 0, 5) == 'HTTP/')) { @@ -717,7 +717,7 @@ function flushHttpHeaders () { } // END - foreach // Mark them as flushed - $GLOBALS['http_header'] = array(); + $GLOBALS['http_header'] = []; } //----------------------------------------------------------------------------- @@ -727,7 +727,7 @@ function flushHttpHeaders () { if (!function_exists('http_build_query')) { // Taken from documentation on www.php.net, credits to Marco K. (Germany) and some light mods by R.Haeder function http_build_query($requestData, $prefix = '', $sep = '', $key = '') { - $ret = array(); + $ret = []; foreach ((array) $requestData as $k => $v) { if (is_int($k) && !is_null($prefix)) { $k = urlencode($prefix . $k); diff --git a/inc/inc-functions.php b/inc/inc-functions.php index b5bfdcfa85..bd6403d7f7 100644 --- a/inc/inc-functions.php +++ b/inc/inc-functions.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { // Init INC_POOL function initIncludePool ($poolName) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'poolName=' . $poolName); - $GLOBALS['inc_pool'][$poolName] = array(); + $GLOBALS['inc_pool'][$poolName] = []; } // Setter for INC_POOL @@ -51,7 +51,7 @@ function setIncludePool ($poolName, $includePool) { function getIncludePool ($poolName) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'poolName=' . $poolName); // Default is empty pool - $poolArray = array(); + $poolArray = []; // Is it set? if (isset($GLOBALS['inc_pool'][$poolName])) { diff --git a/inc/install-functions.php b/inc/install-functions.php index 9b4b42403f..ef4a75edcc 100644 --- a/inc/install-functions.php +++ b/inc/install-functions.php @@ -183,7 +183,7 @@ function doInstallWriteLocalConfigurationFile ($path, $url, $title, $slogan, $em } // Adds a given template with content to install output stream -function addTemplateToInstallContent ($template, $content = array()) { +function addTemplateToInstallContent ($template, $content = []) { // Load the template $out = loadTemplate($template, TRUE, $content); @@ -267,9 +267,9 @@ function generateInstallerDatabaseTypeOptions () { // Generate an option list for database extensions for given default value function generateInstallerDatabaseExtensionOptions () { // Init all arrays - $keys = array(); - $values = array(); - $foundExtensions = array(); + $keys = []; + $values = []; + $foundExtensions = []; // Scan directory $drivers = getArrayFromDirectory('inc/db/', 'lib-', FALSE, FALSE); @@ -401,7 +401,7 @@ function doInstallerPostCheck ($currentTab, &$saveStatus) { // Init 'tab-specific error message' $GLOBALS['installer_post_error'][$currentTab] = ''; - $GLOBALS['installer_failed_fields'][$currentTab] = array(); + $GLOBALS['installer_failed_fields'][$currentTab] = []; // Debug message //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Calling function ' . $callbackName . ',currentTab=' . $currentTab . ',saveStatus[status]=' . $saveStatus['status']); diff --git a/inc/install-inc.php b/inc/install-inc.php index ab96d7b41e..b0770c2e33 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -42,12 +42,12 @@ loadExtension('timezone', 'test'); setConfigEntry('timezone', 'Europe/Berlin'); // Init some things -FILTER_INIT_TIMEZONE(array()); +FILTER_INIT_TIMEZONE([]); FILTER_INIT_RANDOMIZER(); FILTER_INIT_RANDOM_NUMBER(); // Init variables -$GLOBALS['install_mysql'] = array(); +$GLOBALS['install_mysql'] = []; if ((isPostRequestElementSet('mysql')) && (ifPostContainsSelections('mysql'))) { // Transfer 'mysql' array $GLOBALS['install_mysql'] = postRequestElement('mysql'); diff --git a/inc/language-functions.php b/inc/language-functions.php index 0c7fb34275..2878de0514 100644 --- a/inc/language-functions.php +++ b/inc/language-functions.php @@ -65,7 +65,7 @@ function getMaskedMessage ($messageId, $data) { // Init messages function initMessages () { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLanguage()=' . getLanguage()); - $GLOBALS['messages'][getLanguage()] = array(); + $GLOBALS['messages'][getLanguage()] = []; } // Add messages @@ -262,7 +262,7 @@ function getValidLanguages ($except = '') { // Compares two language files function ifLanguageFilesCompares ($source, $target, $targetLanguage) { // Init differences - $GLOBALS['lang_diff'][$target] = array(); + $GLOBALS['lang_diff'][$target] = []; $GLOBALS['lang_diff_count'][$target] = 0; if (!isset($GLOBALS['lang_diff_count']['total'])) { $GLOBALS['lang_diff_count']['total'] = 0; @@ -286,7 +286,7 @@ function ifLanguageFilesCompares ($source, $target, $targetLanguage) { // Backup current messages/language $backupLang = getCurrentLanguage(); $messages[$backupLang] = $GLOBALS['messages'][$backupLang]; - $GLOBALS['messages'][$backupLang] = array(); + $GLOBALS['messages'][$backupLang] = []; // Both are readable so include current language file $GLOBALS['count'] = FALSE; @@ -300,7 +300,7 @@ function ifLanguageFilesCompares ($source, $target, $targetLanguage) { // Is there an array? if (!isset($GLOBALS['messages'][$targetLanguage])) { // Then create it to avoid notice - $GLOBALS['messages'][$targetLanguage] = array(); + $GLOBALS['messages'][$targetLanguage] = []; $GLOBALS['msg_count'][$targetLanguage] = 0; } // END - if diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 2846a620a8..c86049ca9d 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -535,7 +535,7 @@ function sendAdminsEmails ($subject, $template, $content, $userid) { } else { // Load admin ids... // @TODO This can be, somehow, rewritten - $adminIds = array(); + $adminIds = []; while ($content = sqlFetchArray($result)) { array_push($adminIds, $content['admin_id']); } // END - while diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 0bddfd664b..03282f14c3 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -123,7 +123,7 @@ function addBonusRanks ($data, $type, $userid) { // Init variables $self = FALSE; $OUT = ''; - $GLOBALS['ranking_content'] = array(); + $GLOBALS['ranking_content'] = []; // Clear rankings by default $GLOBALS['ranking_content']['rankings'] = ''; diff --git a/inc/libs/forced_functions.php b/inc/libs/forced_functions.php index 42e405b9ae..2fe4c247ee 100644 --- a/inc/libs/forced_functions.php +++ b/inc/libs/forced_functions.php @@ -141,10 +141,10 @@ function generateForcedAdsTypeOptions ($type = NULL) { 'TEXTLINK', 'POPUP', ), - array(), + [], $type, '', '', - array(), + [], 'translateForcedAdsType' ); } // END - if @@ -166,10 +166,10 @@ function generateForcedCostsVisibilityOptions ($visibility = NULL) { 'SPONSOR', 'NONE' ), - array(), + [], $visibility, '', '', - array(), + [], 'translateForcedCostsVisibility' ); } // END - if @@ -181,7 +181,7 @@ function generateForcedCostsVisibilityOptions ($visibility = NULL) { // "Getter" for an array of all given forced ads function getArrayFromForcedAdsByType ($forcedType = NULL) { // Init array - $forcedAds = array(); + $forcedAds = []; // Init WHERE (default) $where = ''; @@ -231,7 +231,7 @@ ORDER BY // "Getter" for an array of all forced costs from given visibility or all function getArrayFromForcedCostsByVisibility ($visibility = NULL) { // Init array - $forcedCosts = array(); + $forcedCosts = []; $where = ''; // Is visibility not NULL? @@ -271,7 +271,7 @@ ORDER BY // "Getter" for an array of all forced campaigns from given array and status function getArrayFromForcedCampaignsByArray ($ids, $status) { // Init array - $forcedCampaigns = array(); + $forcedCampaigns = []; // Search all given types $result = sqlQueryEscaped("SELECT @@ -472,7 +472,7 @@ function prepareForcedContentForTemplate ($content) { // Template helper function to create selection box for all forced-ad types function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = FALSE, $default = NULL) { // Add all types through the filter - $forcedAdTypes = runFilterChain('add_forced_ads_types', array()); + $forcedAdTypes = runFilterChain('add_forced_ads_types', []); // Handle it over to generateSelectionBoxFromArray() $content = generateSelectionBoxFromArray($forcedAdTypes, 'forced_ads_type', 'type', '', '', '', $default); diff --git a/inc/libs/grade_functions.php b/inc/libs/grade_functions.php index b2fe83e395..3abc3c5caf 100644 --- a/inc/libs/grade_functions.php +++ b/inc/libs/grade_functions.php @@ -48,8 +48,8 @@ function generateGradeDataIdOptions ($defaultId = NULL) { $grades = getArrayFromTable('grade_data', array('grade_id', 'grade_name'), 'grade_id'); // Init entries arrays - $gradeKeys = array(); - $gradeValues = array(); + $gradeKeys = []; + $gradeValues = []; // Load all entries foreach ($grades as $grade) { @@ -66,7 +66,7 @@ function generateGradeDataIdOptions ($defaultId = NULL) { $defaultId, '', '', - array(), + [], '', TRUE, FALSE @@ -94,8 +94,8 @@ function generateGradeDataParentIdOptions ($defaultId = NULL) { $grades = getArrayFromTable('grade_data', array('grade_id', 'grade_name'), 'grade_id', 'ASC', $whereStatement); // Init entries arrays - $gradeKeys = array(); - $gradeValues = array(); + $gradeKeys = []; + $gradeValues = []; // Are there entries? foreach ($grades as $grade) { diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index 8915f0fe47..defb0c254b 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -96,7 +96,7 @@ function insertUrlsIntoHtml ($text) { $test = $text; // ... what will the email address be out the @... ;-) - $PARTS = array(); + $PARTS = []; while (isInString('@', $test)) { $pos = strpos($test, '@'); $test2 = substr($test, 0, $pos); diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index 36c132c662..236c7ea2ff 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -129,7 +129,7 @@ function doAdminNetworkProcessForm () { } // END - if // Init global arrays - $GLOBALS['network_types_disabled'] = array(); + $GLOBALS['network_types_disabled'] = []; // Call-back the method handling our request call_user_func($functionName); @@ -242,7 +242,7 @@ function getNetworkDataFromId ($networkId, $column = '') { // Is it cached? if (!isset($GLOBALS['network_data'][$networkId])) { // By default there is no data - $GLOBALS['network_data'][$networkId] = array(); + $GLOBALS['network_data'][$networkId] = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -297,7 +297,7 @@ function getNetworkDataByTypeId ($networkTypeId, $column = '') { // Is it cached? if (!isset($GLOBALS['network_type_data'][$networkTypeId])) { // By default there is no data - $GLOBALS['network_type_data'][$networkTypeId] = array(); + $GLOBALS['network_type_data'][$networkTypeId] = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -363,7 +363,7 @@ function getNetworkTypeDataByTypeId ($networkTypeId) { // Is it set? if (!isset($GLOBALS['network_type_data'][$networkTypeId])) { // By default there is no data - $GLOBALS['network_type_data'][$networkTypeId] = array(); + $GLOBALS['network_type_data'][$networkTypeId] = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -405,7 +405,7 @@ function getNetworkTypeDataFromId ($networkId) { // Is it set? if (!isset($GLOBALS['network_types'][$networkId])) { // By default there is no data - $GLOBALS['network_types'][$networkId] = array(); + $GLOBALS['network_types'][$networkId] = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -449,7 +449,7 @@ function getNetworkRequestParamsDataFromId ($networkRequestId) { } // END - if // By default there is no data - $networkRequestData = array(); + $networkRequestData = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -488,7 +488,7 @@ function getNetworkArrayTranslationsDataFromId ($networkTranslationId) { } // END - if // By default there is no data - $networkTranslationData = array(); + $networkTranslationData = []; // Query for the network data $result = sqlQueryEscaped('SELECT @@ -528,7 +528,7 @@ function getNetworkRequestParametersByTypeId ($networkTypeId) { // Is it cached? if (!isset($GLOBALS['network_request_parameters'][$networkTypeId])) { // By default there is no data - $GLOBALS['network_request_parameters'][$networkTypeId] = array(); + $GLOBALS['network_request_parameters'][$networkTypeId] = []; // Search for all $result = sqlQueryEscaped('SELECT @@ -575,7 +575,7 @@ function getFullNetworkConfigurationByTypeId ($networkTypeId) { // Is it cached? if (!isset($GLOBALS['network_full_config'][$networkTypeId])) { // By default there is no data - $GLOBALS['network_full_config'][$networkTypeId] = array(); + $GLOBALS['network_full_config'][$networkTypeId] = []; // Search for all $result = sqlQueryEscaped('SELECT @@ -669,7 +669,7 @@ ORDER BY // Are there entries? if (!ifSqlHasZeroNumRows($result)) { // List all entries - $rows = array(); + $rows = []; while ($row = sqlFetchArray($result)) { // Is this valid, then add it if ((is_array($row)) && (isset($row['network_id']))) { @@ -746,7 +746,7 @@ ORDER BY // Are there entries? if (!ifSqlHasZeroNumRows($result)) { // List all entries - $rows = array(); + $rows = []; while ($row = sqlFetchArray($result)) { // Is this valid, then add it if ((is_array($row)) && (isset($row['network_type_id']))) { @@ -793,7 +793,7 @@ ORDER BY // Are there entries? if (!ifSqlHasZeroNumRows($result)) { // List all entries - $rows = array(); + $rows = []; while ($row = sqlFetchArray($result)) { // Is this valid, then add it if ((is_array($row)) && (isset($row['network_type_id']))) { @@ -897,7 +897,7 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) { 'signature_click', 'signature_view', ), - array(), + [], $defaultType, '', '', $GLOBALS['network_types_disabled'], @@ -920,10 +920,10 @@ function generateNetworkTextEncodingAvailableOptions ($defaultEncoding = NULL) { 'NONE', 'BASE64', ), - array(), + [], $defaultEncoding, '', '', - array(), + [], 'translateNetworkTextEncoding' ); } // END - if @@ -957,7 +957,7 @@ function generateNetworkRequestKeyOptions () { 'extra', 'country' ), - array(), + [], '', '', '', $GLOBALS['network_request_params_disabled'], @@ -1395,7 +1395,7 @@ function translateNetworkApiIndex ($index) { // Is there cache? if (!isset($GLOBALS['network_array_index'])) { // Get an array of all API array indexes - $GLOBALS['network_array_index'] = array(); + $GLOBALS['network_array_index'] = []; // Get all entries $result = sqlQuery('SELECT @@ -1515,7 +1515,7 @@ function doNetworkUpdateDataByArray ($networkId, $networkData) { } // END - if // Just call our inner method - return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), FALSE, FALSE); + return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), [], FALSE, FALSE); } // Updates given network type handler (id) with data from array @@ -1527,7 +1527,7 @@ function doNetworkUpdateTypeByArray ($networkTypeId, $networkTypeData) { } // END - if // Just call our inner method - return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), array(), FALSE, FALSE); + return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), [], FALSE, FALSE); } // Updates given network request parameters (id) with data from array @@ -1539,7 +1539,7 @@ function doNetworkUpdateParamsByArray ($networkParamsId, $networkParamsData) { } // END - if // Just call our inner method - return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), array(), FALSE, FALSE); + return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), [], FALSE, FALSE); } // Updates given network array translations (id) with data from array @@ -1551,7 +1551,7 @@ function doNetworkUpdateArrayTranslationsByArray ($networkTranslationsId, $netwo } // END - if // Just call our inner method - return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), array(), FALSE, FALSE); + return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), [], FALSE, FALSE); } //------------------------------------------------------------------------------ @@ -1941,7 +1941,7 @@ function doAdminNetworkProcessHandleRequestParams () { // Is there selections? if (ifPostContainsSelections()) { // Init cache array - $GLOBALS['network_request_params_disabled'] = array(); + $GLOBALS['network_request_params_disabled'] = []; // Load network data $networkData = getNetworkDataFromId(getRequestElement('network_id')); @@ -2012,7 +2012,7 @@ function doAdminNetworkProcessChangeNetworks () { // Update this entry? if ($sel == 1) { // Init data array - $networkData = array(); + $networkData = []; // Transfer whole array, except 'sel' foreach (postRequestArray() as $key => $entry) { @@ -2125,7 +2125,7 @@ function doAdminNetworkProcessChangeHandlerTypes () { // Update this entry? if ($sel == 1) { // Init data array - $networkTypeData = array(); + $networkTypeData = []; // Transfer whole array, except 'sel' foreach (postRequestArray() as $key => $entry) { @@ -2178,7 +2178,7 @@ function doAdminNetworkProcessChangeRequestParams () { // Update this entry? if ($sel == 1) { // Init data array - $networkParamsData = array(); + $networkParamsData = []; // Transfer whole array, except 'sel' foreach (postRequestArray() as $key => $entry) { @@ -2231,7 +2231,7 @@ function doAdminNetworkProcessChangeArrayTranslation () { // Update this entry? if ($sel == 1) { // Init data array - $networkTranslationsData = array(); + $networkTranslationsData = []; // Transfer whole array, except 'sel' foreach (postRequestArray() as $key => $entry) { @@ -2428,7 +2428,7 @@ function doAdminNetworkProcessHandleArrayTranslations () { // Is there selections? if (ifPostContainsSelections()) { // Init cache array - $GLOBALS['network_array_translation_disabled'] = array(); + $GLOBALS['network_array_translation_disabled'] = []; // Load network data $networkData = getNetworkDataFromId(getRequestElement('network_id')); @@ -3077,7 +3077,7 @@ function doAjaxAdminNetworkQuerySingleApi () { * keys, network_request_param_default contains values. Now the request can * be build. */ - $requestData = array(); + $requestData = []; foreach ($requestParams as $key => $params) { // Add id $requestData[$params['network_request_param_value']] = $params['network_request_param_default']; diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php index fd66fcdc63..f745db80c7 100644 --- a/inc/libs/newsletter_functions.php +++ b/inc/libs/newsletter_functions.php @@ -69,7 +69,7 @@ function insertNewsletterUrls ($text) { $test = $text; // ... what will the email address be out the @... ;-) - $PARTS = array(); + $PARTS = []; while (isInString('@', $test)) { $pos = strpos($test, '@'); $test2 = substr($test, 0, $pos); diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index 3cd4b7370d..c385a2a68b 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -42,7 +42,7 @@ if (!defined('__SECURITY')) { // Part taken from admin optimize module of PHPNuke (http://www.phpnuke.org) function repairOptimizeDatabase () { - $ret = array(); + $ret = []; $tot_data = '0'; $opts = '0'; $tot_idx = '0'; @@ -55,7 +55,7 @@ function repairOptimizeDatabase () { // Init array $ret['total_size'] = '0'; $ret['total_tabs'] = sqlNumRows($result); - $ret['tables'] = array(); + $ret['tables'] = []; // Are there entries? if (!ifSqlHasZeroNumRows($result)) { diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 07ef18a2a5..8a6ef504c3 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -260,9 +260,9 @@ ORDER BY // Load users $content = array( - 'userid' => array(), - 'ref' => array(), - 'cpoints' => array() + 'userid' => [], + 'ref' => [], + 'cpoints' => [] ); // Load all users @@ -373,7 +373,7 @@ function sendRallyeNotification ($userid, $content) { } // Run this function only when a new member has confirmed his email address! -function addUserToReferralRallye ($userid, $content = array()) { +function addUserToReferralRallye ($userid, $content = []) { $add = ''; // Updated extension? @@ -490,7 +490,7 @@ function stopRallyeByResult ($result) { // Init array $count = '0'; - $users = array(); + $users = []; $content['start_time'] = generateDateTime($content['start_time'], 1); $content['end_time'] = generateDateTime($content['end_time'] , 1); $content['now_time'] = generateDateTime(time(), 1); @@ -643,9 +643,9 @@ LIMIT %s", function getArrayFromReferralRallyePrices ($rallye) { // Init multi array $prices = array( - 'level' => array(), - 'points' => array(), - 'info' => array() + 'level' => [], + 'points' => [], + 'info' => [] ); // Load prices @@ -684,9 +684,9 @@ function getArrayFromReferralRallyeUsers ($rallye) { // Init multi array $users = array( - 'userid' => array(), - 'ref' => array(), - 'cpoints' => array(), + 'userid' => [], + 'ref' => [], + 'cpoints' => [], ); /* @@ -886,13 +886,13 @@ WHERE function addReferralRallyeTemplateSelection ($name = 'template', $default = '') { // Init variables $OUT = ''; - $ral = array(); + $ral = []; // Check templates directory $basePath = sprintf('templates/%s/html/rallye/', getLanguage()); // Read the directory - $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, array(), '.tpl'); + $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, [], '.tpl'); // And walk through foreach ($templates as $read) { diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 37d5adfbfb..a09fd6d507 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -176,7 +176,7 @@ function getRefbackPercents ($userid, $refid) { function getArrayFromRefbackLevel ($refid, $level) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ' - ENTERED!'); // Init userids - $userIds = array(); + $userIds = []; // Look for all $result = sqlQueryEscaped("SELECT @@ -212,7 +212,7 @@ ORDER BY function getArrayFromRefbackUserRefs ($userid, $level) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!'); // Default is no refs and no nickname - $refs = array(); + $refs = []; // Get refs from database $result = sqlQueryEscaped("SELECT @@ -262,7 +262,7 @@ ORDER BY function getArrayFromUserRefbackData ($id) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ' - ENTERED!'); // Default data is nothing - $data = array(); + $data = []; // Secure id number $id = bigintval($id); diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index d7d6df0f16..9e1402fcc4 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { } // END - if // -function handleSponsorRequest ($postData, $update=false, $messageArray = array(), $RET_STATUS=false) { +function handleSponsorRequest ($postData, $update=false, $messageArray = [], $RET_STATUS=false) { // Init a lot variables $SAVE = TRUE; $UPDATE = FALSE; @@ -56,8 +56,8 @@ function handleSponsorRequest ($postData, $update=false, $messageArray = array() // Save sponsor data $DATA = array( - 'keys' => array(), - 'values' => array() + 'keys' => [], + 'values' => [] ); // Check if sponsor already exists @@ -411,7 +411,7 @@ function saveSponsorData ($postData, $content) { // This array is for the submitted data which we will use with the sqlQueryEscaped() function to // secure the data - $DATA = array(); + $DATA = []; // Prepare SQL string $sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET"; @@ -560,7 +560,7 @@ LIMIT 1", } // Processes a sponsor request and handles it -function doProcessSponsorFormRequest ($messageArray = array()) { +function doProcessSponsorFormRequest ($messageArray = []) { // Default message $message = ''; diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 9047298077..1b4a4aaf26 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -590,7 +590,7 @@ function ifSurfbarHasUrlUserId ($url, $userid) { // Load URL data by given search term and column function getSurfbarUrlData ($searchTerm, $column = 'url_id', $order = 'url_id', $sort = 'ASC', $group = 'url_id', $add = '') { // By default nothing is found - $GLOBALS['last_url_data'] = array(); + $GLOBALS['last_url_data'] = []; // Is the column an id number? if (($column == 'url_id') || ($column == 'url_userid')) { @@ -659,7 +659,7 @@ ORDER BY } // Registers an URL with the surfbar. You should have called ifSurfbarHasUrlUserId() first! -function doSurfbarRegisterUrl ($url, $userid, $status = 'PENDING', $addMode = 'reg', $extraFields = array()) { +function doSurfbarRegisterUrl ($url, $userid, $status = 'PENDING', $addMode = 'reg', $extraFields = []) { // Make sure by the user registered URLs are always pending if ($addMode == 'reg') { $status = 'PENDING'; @@ -1288,9 +1288,9 @@ LIMIT 1', function determineSurfbarDepletedUserids ($limit=0) { // Init array $userids = array( - 'url_userid' => array(), - 'points' => array(), - 'notified' => array(), + 'url_userid' => [], + 'points' => [], + 'notified' => [], ); // Is there a current user id? @@ -1412,7 +1412,7 @@ function determineSurfbarWaitingTime () { } // Changes the status of an URL from given to other -function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array()) { +function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = []) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',data[]=' . gettype($data) . ',newStatus=' . $newStatus . ' - ENTERED!'); // Make new status always lower-case $newStatus = strtolower($newStatus); @@ -1547,9 +1547,9 @@ function calculateSurfbarDynamicLock () { // "Getter" for lock ids array function getSurfbarLockIdsArray () { // Prepare some arrays - $IDs = array(); - $USE = array(); - $ignored = array(); + $IDs = []; + $USE = []; + $ignored = []; // Get all id from locks within the timestamp $result = sqlQueryEscaped("SELECT @@ -1640,7 +1640,7 @@ GROUP BY // Load all URLs of the current user and return it as an array function getSurfbarUserUrls () { // Init array - $urlArray = array(); + $urlArray = []; // Begin the query $result = sqlQueryEscaped("SELECT @@ -1683,7 +1683,7 @@ ORDER BY // "Getter" for member action array for given status function getSurfbarArrayFromStatus ($status) { // Init array - $returnArray = array(); + $returnArray = []; // Get all assigned actions $result = sqlQueryEscaped("SELECT `actions_action` FROM `{?_MYSQL_PREFIX?}_surfbar_actions` WHERE `actions_status`='%s' ORDER BY `actions_id` ASC", @@ -2143,7 +2143,7 @@ function doTemplateSurfbarActionsNewStatusSelectionBox ($templateName, $clear = // Initializes the surfbar function initSurfbar () { // Init cache array - $GLOBALS['surfbar_cache'] = array(); + $GLOBALS['surfbar_cache'] = []; } // Private getter for data elements diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 9142672cab..970e995d01 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -53,9 +53,9 @@ function outputAdvancedOverview (&$result_main) { // Init variables/arrays $EXTRAS = ''; $OUT = ''; - $WHATs = array(); - $DESCRs = array(); - $TITLEs = array(); + $WHATs = []; + $DESCRs = []; + $TITLEs = []; // Chheck for new extensions and updates $jobsDone = outputStandardOverview($result_main); @@ -251,7 +251,7 @@ function outputAdvancedOverview (&$result_main) { if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) { // Start finding them... $userExclusionSql = ' '; - $excludedUserids = runFilterChain('config_userid_exclusion_sql', array()); + $excludedUserids = runFilterChain('config_userid_exclusion_sql', []); if (count($excludedUserids) > 0) { // Exclude all $userExclusionSql .= ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')'; diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 1bba6cccc9..25b337d46c 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -52,8 +52,8 @@ function generateThemeSelectionBox () { // Initialize array $themesArray = array( - 'theme_unix' => array(), // Unix name from filesystem - 'theme_name' => array() // Title + 'theme_unix' => [], // Unix name from filesystem + 'theme_name' => [] // Title ); // Only activated themes for the user diff --git a/inc/libs/transaction_functions.php b/inc/libs/transaction_functions.php index 682c97b82f..c4753af652 100644 --- a/inc/libs/transaction_functions.php +++ b/inc/libs/transaction_functions.php @@ -182,8 +182,8 @@ function doTryConfirmTransactions (array $post) { $confirmed = FALSE; // Init arrays/variables - $confirmedIds = array(); - $failedIds = array(); + $confirmedIds = []; + $failedIds = []; $points = 0; // "Walk" through all transaction ids @@ -199,7 +199,7 @@ function doTryConfirmTransactions (array $post) { } // Init data array - $data = array(); + $data = []; // Try to load more transaction data $result = sqlQueryEscaped("SELECT diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 5c0dcb4946..07c71ce741 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -706,7 +706,7 @@ function doResendUserConfirmationLink ($email) { // Is the account unconfirmed? if ($content['status'] == 'UNCONFIRMED') { // Load email template - $message = loadEmailTemplate('guest_request_confirm', array(), $content['userid']); + $message = loadEmailTemplate('guest_request_confirm', [], $content['userid']); // Send email sendEmail($content['userid'], '{--GUEST_REQUEST_CONFIRM_LINK_SUBJECT--}', $message); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 8d41d9e751..aa3c207613 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -72,7 +72,7 @@ function getWernisErrorCode () { } // Sends out a request to the API and returns it's result -function sendWernisApiRequest ($scriptName, $requestData = array()) { +function sendWernisApiRequest ($scriptName, $requestData = []) { // Debug call //* DEBUG */ reportBug(__FUNCTION__, __LINE__, 'scriptName=' . $scriptName . ',requestData=
    ' . print_r($requestData, TRUE) . '
    '); @@ -157,7 +157,7 @@ function sendWernisApiRequest ($scriptName, $requestData = array()) { $data = explode('=', $responseLine); // Default return array (should not stay empty) - $return = array(); + $return = []; // We use only the first two entries (which shall be fine) if ($data[0] === 'error') { @@ -683,13 +683,13 @@ function getWernisMappedDataFromApiByChallenge ($challenge, $challengeResponse, // Display form loadTemplate('guest_wernis_registration_rpc_form'); - return array(); + return []; } // END - if // Init array $return = array( // Mapped data - 'mapped_data' => array(), + 'mapped_data' => [], // Any error message from API 'message' => '' ); @@ -799,7 +799,7 @@ LIMIT 1", // "Getter" for Wernis registration data by given key and value function getWernisRegistrationDataByKey ($key, $value, $limit = 1) { // Init array - $rows = array(); + $rows = []; // Now search for it $result = sqlQueryEscaped("SELECT @@ -1019,7 +1019,7 @@ function doTemplateSelectWernisEncryptionAlgorithm ($templateName, $clear = FALS //* DEBUG-DIE */ die('algorithms=
    ' . print_r($algorithms, TRUE) . '
    '); // Init array - $options = array(); + $options = []; // And fill it foreach ($algorithms as $key => $dummy) { @@ -1039,7 +1039,7 @@ function doTemplateSelectWernisEncryptionMode ($templateName, $clear = FALSE, $d $modes = getSupportedEncryptionModes(); // Init array - $options = array(); + $options = []; // And fill it foreach ($modes as $key => $dummy) { diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index a1b880104a..1cec650162 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { // Queries the given Yoo!Media API 2.0 script function YOOMEDIA_QUERY_API ($script, $countQuery = TRUE) { // Init response array - $response = array(); + $response = []; // Enougth queries left? if ((getConfig('yoomedia_requests_remain') > 0) || ($countQuery === FALSE)) { @@ -138,7 +138,7 @@ function YOOMEDIA_GET_PARSED_RESULT_TEXTMAILS () { $response = YOOMEDIA_QUERY_API('out_textmail.php'); // By default an empty result is returned - $result = array(); + $result = []; // Parse the response if (isFilledArray($response)) { @@ -152,7 +152,7 @@ function YOOMEDIA_GET_PARSED_RESULT_TEXTMAILS () { // Parser function for Yoo!Media API responses function YOOMEDIA_PARSE_RESPONSE ($response, $type) { // Init result - $result = array(); + $result = []; // Cut off the header $dummy = removeHttpHeaderFromResponse($response); @@ -161,7 +161,7 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) { if (!isFilledArray($dummy)) { // Empty response from API reportBug(__FUNCTION__, __LINE__, 'Empty result from API received. response()=' . count($response) . ',type=' . $type); - return array(); + return []; } // END - if // The result is now still raw, so we must split it up and trim spaces away diff --git a/inc/load_cache.php b/inc/load_cache.php index f0796194c4..33b5d49908 100644 --- a/inc/load_cache.php +++ b/inc/load_cache.php @@ -45,7 +45,7 @@ initCacheInstance(); initExtensionCssFiles(); // Initialize array for "always keep active extensions" -$GLOBALS['cache_array']['always_active'] = array(); +$GLOBALS['cache_array']['always_active'] = []; // Init & set the INC_POOL initIncludePool('cache'); diff --git a/inc/loader/load-admins.php b/inc/loader/load-admins.php index 580c9cbf4b..6bcc3c9b86 100644 --- a/inc/loader/load-admins.php +++ b/inc/loader/load-admins.php @@ -49,7 +49,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('admin')) && ($GLOBALS['cache_ins // Check count if (count($GLOBALS['cache_array']['admin']['login']) == count($GLOBALS['cache_array']['admin']['admin_id'])) { // Rewrite the cache - $admins = array(); + $admins = []; foreach ($GLOBALS['cache_array']['admin']['login'] as $idx => $admin) { // Rewrite all entries foreach ($GLOBALS['cache_array']['admin'] as $key => $entry) { @@ -120,7 +120,7 @@ if (isExtensionInstalledAndNewer('admins', '0.3')) { // Check count if (count($GLOBALS['cache_array']['admin_acls']['admin_id']) == count($GLOBALS['cache_array']['admin_acls']['access_mode'])) { // Rewrite the cache - $admins = array(); + $admins = []; foreach ($GLOBALS['cache_array']['admin_acls']['admin_id'] as $idx => $admin) { // Rewrite all entries foreach ($GLOBALS['cache_array']['admin_acls'] as $key => $entry) { diff --git a/inc/loader/load-extension.php b/inc/loader/load-extension.php index e72c9f4271..c501692b69 100644 --- a/inc/loader/load-extension.php +++ b/inc/loader/load-extension.php @@ -47,12 +47,12 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache $EXT_DUMMY = $GLOBALS['cache_instance']->getArrayFromCache(); // Init extension inc-pool - $EXT_POOL = array(); + $EXT_POOL = []; // Are there entries? if (count($EXT_DUMMY) > 0) { // Init arrays - $EXT_NAMES = array(); + $EXT_NAMES = []; // Loop through all foreach ($EXT_DUMMY['ext_name'] as $k => $ext_name) { diff --git a/inc/loader/load-payments.php b/inc/loader/load-payments.php index 164471d2b8..a197046cdc 100644 --- a/inc/loader/load-payments.php +++ b/inc/loader/load-payments.php @@ -45,7 +45,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('payments')) && ($GLOBALS['cache_ $GLOBALS['cache_array']['payments'] = $GLOBALS['cache_instance']->getArrayFromCache(); // Init temporary array - $paymentsData = array(); + $paymentsData = []; // Rewrite all to id foreach ($GLOBALS['cache_array']['payments']['id'] as $key => $id) { diff --git a/inc/loader/load-points_data.php b/inc/loader/load-points_data.php index 4c8dd0701b..71b91ad8cb 100644 --- a/inc/loader/load-points_data.php +++ b/inc/loader/load-points_data.php @@ -57,7 +57,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('points_data')) && ($GLOBALS['cac } // END - if // Init temporary array - $pointsData = array(); + $pointsData = []; // Rewrite all to subject foreach ($GLOBALS['cache_array']['points_data']['subject'] as $key => $subject) { diff --git a/inc/loader/load-themes.php b/inc/loader/load-themes.php index fe5784ff1c..275ec30e71 100644 --- a/inc/loader/load-themes.php +++ b/inc/loader/load-themes.php @@ -48,7 +48,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('themes')) && ($GLOBALS['cache_in $cache = $GLOBALS['cache_instance']->getArrayFromCache(); // Restructure the array - $GLOBALS['cache_array']['themes'] = array(); + $GLOBALS['cache_array']['themes'] = []; foreach ($cache as $key => $content) { // Skip 'theme_path' because we don't need to rebuild it if ($key == 'theme_path') { diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 58fae33f77..de7f2d1792 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -92,7 +92,7 @@ if (!empty($sql)) { // Load message body for bonus mails $message = loadEmailTemplate('beg_enable_notify_body', '', '{PER}userid{PER}'); - $receiver = ''; $userids = array(); + $receiver = ''; $userids = []; // Okay lets notify all users! while ($row = sqlFetchArray($result_main)) { diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 58a0dcd979..cb2bb7870a 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -80,7 +80,7 @@ if (!empty($sql)) { // Load message body for bonus mails $message = loadEmailTemplate('bonus_enable_notify_body', '', '{PER}userid{PER}'); - $receiver = ''; $userids = array(); + $receiver = ''; $userids = []; // Check for accounts to be notified $result_main = sqlQuery($sql, __FILE__, __LINE__); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index a18dd7f49f..d5e5276689 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -265,8 +265,8 @@ function addAdminMenu ($action, $what) { $OUT = ''; // Menu descriptions - $GLOBALS['menu']['description'] = array(); - $GLOBALS['menu']['title'] = array(); + $GLOBALS['menu']['description'] = []; + $GLOBALS['menu']['title'] = []; // Build main menu $result_main = sqlQuery("SELECT @@ -573,7 +573,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') { } // Wrapper for $_POST and adminSaveSettings -function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) { +function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = [], $alwaysAdd = FALSE, $displayMessage = TRUE) { // Get the array $postData = postRequestArray(); @@ -582,9 +582,9 @@ function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement } // Save settings to the database -function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) { +function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = [], $alwaysAdd = FALSE, $displayMessage = TRUE) { // Prepare all arrays, variables - $tableData = array(); + $tableData = []; $skip = FALSE; // Now, walk through all entries and prepare them for saving @@ -655,7 +655,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement ); } else { // Add Line (does only work with AUTO_INCREMENT! - $keys = array(); $values = array(); + $keys = []; $values = []; foreach ($tableData as $entry) { // Split up $line = explode('=', $entry); @@ -883,13 +883,13 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') { // Build a special template list // @TODO cacheFiles is not yet supported -function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) { +function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) { // Call inner (general) function doGenericListBuilder('admin', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId, $content); } // Change status of "build" list -function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $rawUserId = array('userid'), $cacheFiles = array()) { +function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $rawUserId = array('userid'), $cacheFiles = []) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -985,7 +985,7 @@ function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunction } // Delete rows by given id numbers -function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) { +function adminDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -1021,7 +1021,7 @@ function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunct } // Edit rows by given id numbers -function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) { +function adminEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -1058,7 +1058,7 @@ function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctio // Un-/lock rows by given id numbers // @TODO rawUserId/content is not yet supported -function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) { +function adminLockEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $statusArray = [], $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -1083,7 +1083,7 @@ function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctio // Undelete rows by given id numbers // @TODO rawUserId/cacheFiles/content is not yet supported -function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) { +function adminUndeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $statusArray = [], $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) { // $tableName must be an array if ((!is_array($tableName)) || (count($tableName) != 1)) { // No tableName specified @@ -1107,7 +1107,7 @@ function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFun } // Adds a given entry to the database -function adminAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) { +function adminAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) { // Is the userid set? if (!isPostRequestElementSet('userid')) { // Then set NULL here diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 357f55cac1..31d0110c7c 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -50,9 +50,9 @@ if ((isFormSent()) && ((!isPostRequestElementSet('title')) || (!isPostRequestEle if (!isFormSent()) { // Create arrays - $menus = array(); - $titles = array(); - $below = array(); + $menus = []; + $titles = []; + $below = []; // Get all available main menus $result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); @@ -97,9 +97,9 @@ if (!isFormSent()) { array($value_main), __FILE__, __LINE__); if (!ifSqlHasZeroNumRows($result)) { // Init arrays - $menus[$value_main] = array(); - $titles[$value_main] = array(); - $below[$value_main] = array(); + $menus[$value_main] = []; + $titles[$value_main] = []; + $below[$value_main] = []; // Read menu structure while ($content = sqlFetchArray($result)) { diff --git a/inc/modules/admin/what-admins_edit.php b/inc/modules/admin/what-admins_edit.php index a06301d87b..003760b60c 100644 --- a/inc/modules/admin/what-admins_edit.php +++ b/inc/modules/admin/what-admins_edit.php @@ -45,7 +45,7 @@ addYouAreHereLink('admin', __FILE__); // Set selection data to empty array when it is empty if (!isPostRequestElementSet('sel')) { - setPostRequestElement('sel', array()); + setPostRequestElement('sel', []); } // END - if // Check if direct admin account was selected diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 2c67f0258c..a848a9b75a 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -49,7 +49,7 @@ if (isFormSent('save_config')) { // Generate string for saving ranks setPostRequestElement('turbo_rates', ''); - $RATES = array(); + $RATES = []; foreach (postRequestElement('rate') as $rate) { // Convert German comma to dot $rate = trim(convertCommaToDot($rate)); diff --git a/inc/modules/admin/what-config_rewrite.php b/inc/modules/admin/what-config_rewrite.php index b10593efc2..d4ac96a5b6 100644 --- a/inc/modules/admin/what-config_rewrite.php +++ b/inc/modules/admin/what-config_rewrite.php @@ -45,7 +45,7 @@ addYouAreHereLink('admin', __FILE__); if (isFormSent('save_config')) { // Generate string - $MODs = array(); + $MODs = []; foreach (postRequestElement('mod') as $mod => $sel) { // Now you can never deselect the admin module, bah!!! ;-) if (($sel == 'Y') || ($mod == 'admin')) { diff --git a/inc/modules/admin/what-config_secure.php b/inc/modules/admin/what-config_secure.php index 5dc74dce32..67aa0c8d29 100644 --- a/inc/modules/admin/what-config_secure.php +++ b/inc/modules/admin/what-config_secure.php @@ -60,7 +60,7 @@ if (isFormSent('save_config')) { adminSaveSettingsFromPostData(); } else { // Prepare content - $content = array(); + $content = []; // Loop all scores for ($idx = 0; $idx <= 5; $idx++) { diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 2a6095cc59..fd0167cc80 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -51,7 +51,7 @@ if (((!isPostRequestElementSet('title')) || (!isPostRequestElementSet('menu'))) if (!isFormSent()) { // Create arrays - $menus = array(); $titles = array(); $below = array(); + $menus = []; $titles = []; $below = []; // Get all available main menus $result_menu = sqlQuery("SELECT @@ -111,9 +111,9 @@ ORDER BY `sort` ASC", if (!ifSqlHasZeroNumRows($result)) { // Initialize arrays - $menus[$value_main] = array(); - $titles[$value_main] = array(); - $below[$value_main] = array(); + $menus[$value_main] = []; + $titles[$value_main] = []; + $below[$value_main] = []; // Read menu structure while ($content = sqlFetchArray($result)) { diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index ebd36f0087..966e58b751 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -45,7 +45,7 @@ addYouAreHereLink('admin', __FILE__); // Exclude default referral id if set $userExcludeSql = ' '; -$excludedUserids = runFilterChain('config_userid_exclusion_sql', array()); +$excludedUserids = runFilterChain('config_userid_exclusion_sql', []); if (isFilledArray($excludedUserids)) { // Exclude all $userExcludeSql = ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')'; diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php index 555b01f61e..f99c1e5328 100644 --- a/inc/modules/admin/what-list_bank_package.php +++ b/inc/modules/admin/what-list_bank_package.php @@ -115,9 +115,9 @@ if (ifPostContainsSelections('id')) { array('id'), array('bank_packages'), postRequestElement('id'), - array(), - array(), - array(), + [], + [], + [], array(TRUE) ); } elseif (isFormSent('delete')) { @@ -152,9 +152,9 @@ if (ifPostContainsSelections('id')) { array('id'), array('bank_packages'), postRequestElement('id'), - array(), - array(), - array(), + [], + [], + [], array(TRUE) ); } diff --git a/inc/modules/admin/what-list_network_array_translation.php b/inc/modules/admin/what-list_network_array_translation.php index 1ef12fe809..2a26e87d56 100644 --- a/inc/modules/admin/what-list_network_array_translation.php +++ b/inc/modules/admin/what-list_network_array_translation.php @@ -70,7 +70,7 @@ if (isGetRequestElementSet('network_id')) { $networkData['network_type_id'] = 0; // Init disabled list - $GLOBALS['network_array_translation_disabled'] = array(); + $GLOBALS['network_array_translation_disabled'] = []; // Only show params from given type handler if choosen $ADD = ''; diff --git a/inc/modules/admin/what-list_network_request_params.php b/inc/modules/admin/what-list_network_request_params.php index ee2b0542a1..3a6bea3c50 100644 --- a/inc/modules/admin/what-list_network_request_params.php +++ b/inc/modules/admin/what-list_network_request_params.php @@ -68,7 +68,7 @@ if (isGetRequestElementSet('network_id')) { $networkData['network_type_id'] = 0; // Init disabled list - $GLOBALS['network_request_params_disabled'] = array(); + $GLOBALS['network_request_params_disabled'] = []; // Only show params from given type handler if choosen $ADD = ''; diff --git a/inc/modules/admin/what-list_network_types.php b/inc/modules/admin/what-list_network_types.php index 80f48c97fb..b325ccae15 100644 --- a/inc/modules/admin/what-list_network_types.php +++ b/inc/modules/admin/what-list_network_types.php @@ -67,7 +67,7 @@ if (isGetRequestElementSet('network_id')) { $networkData = getNetworkDataFromId(getRequestElement('network_id')); // Init disabled list - $GLOBALS['network_types_disabled'] = array(); + $GLOBALS['network_types_disabled'] = []; // Load all advert types for given network $result = sqlQueryEscaped('SELECT diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php index ab3974e6a8..2618a65b7b 100644 --- a/inc/modules/admin/what-list_notifications.php +++ b/inc/modules/admin/what-list_notifications.php @@ -88,7 +88,7 @@ if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNumRows($result_max)) && (!emp $numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5); // List emails - $OUT = ''; $content = array(); + $OUT = ''; $content = []; while ($content = sqlFetchArray($result_bonus)) { // Add "unconfirmed-link" $content['unconfirmed_content'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed'], 'bonus'); diff --git a/inc/modules/admin/what-list_user_amounts.php b/inc/modules/admin/what-list_user_amounts.php index dd8be5ec7b..60288b9fcb 100644 --- a/inc/modules/admin/what-list_user_amounts.php +++ b/inc/modules/admin/what-list_user_amounts.php @@ -75,7 +75,7 @@ ORDER BY if (!ifSqlHasZeroNumRows($result)) { // Init amounts and points $totalPoints = '0'; - $amounts = array(); + $amounts = []; // Then load all while ($row = sqlFetchArray($result)) { diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index 659e27596f..eba4856732 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -51,9 +51,9 @@ if ((!isPostRequestElementSet('title')) && (isFormSent())) { if (!isFormSent()) { // Create arrays - $menus = array(); - $titles = array(); - $below = array(); + $menus = []; + $titles = []; + $below = []; // Get all available main menus $result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", @@ -101,9 +101,9 @@ if (!isFormSent()) { array($value_main), __FILE__, __LINE__); if (!ifSqlHasZeroNumRows($result)) { // Initialize arrays - $menus[$value_main] = array(); - $titles[$value_main] = array(); - $below[$value_main] = array(); + $menus[$value_main] = []; + $titles[$value_main] = []; + $below[$value_main] = []; // Read menu structure while ($content = sqlFetchArray($result)) { diff --git a/inc/modules/admin/what-repair_amnu.php b/inc/modules/admin/what-repair_amnu.php index e895570ca7..b7be0555b6 100644 --- a/inc/modules/admin/what-repair_amnu.php +++ b/inc/modules/admin/what-repair_amnu.php @@ -43,7 +43,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); -$actions = array(); +$actions = []; // First fix all main menus (what = '')... $result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-repair_gmnu.php b/inc/modules/admin/what-repair_gmnu.php index a6b7e3433f..7a609ebd6a 100644 --- a/inc/modules/admin/what-repair_gmnu.php +++ b/inc/modules/admin/what-repair_gmnu.php @@ -43,7 +43,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); -$actions = array(); +$actions = []; // First fix all main menus (what = '')... $result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-repair_mmnu.php b/inc/modules/admin/what-repair_mmnu.php index a8ac993504..b58ed77175 100644 --- a/inc/modules/admin/what-repair_mmnu.php +++ b/inc/modules/admin/what-repair_mmnu.php @@ -43,7 +43,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); -$actions = array(); +$actions = []; // First fix all main menus (what = '')... $result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-send_coupon.php b/inc/modules/admin/what-send_coupon.php index 50b425532a..002ec2a917 100644 --- a/inc/modules/admin/what-send_coupon.php +++ b/inc/modules/admin/what-send_coupon.php @@ -85,7 +85,7 @@ ORDER BY $couponId = getSqlInsertId(); // Init userid array - $adminUserids = array(); + $adminUserids = []; // Load entry while (list($userid) = sqlFetchRow($result)) { diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index 11fd8829f6..47f0107f68 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -84,12 +84,12 @@ VALUES ('%s','N','%s','%s')", // Initialize array $themes = array( - 'theme_unix' => array(), // Unix name from filesystem - 'theme_name' => array(), // Title - 'theme_author' => array(), // Theme author's name - 'theme_email' => array(), // Author's email address - 'theme_url' => array(), // URL were you can download it from - 'theme_version' => array(), // Version number of theme + 'theme_unix' => [], // Unix name from filesystem + 'theme_name' => [], // Title + 'theme_author' => [], // Theme author's name + 'theme_email' => [], // Author's email address + 'theme_url' => [], // URL were you can download it from + 'theme_version' => [], // Version number of theme ); // Read directory "themes" diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index 27a5a391fc..3c3313ee7a 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -44,7 +44,7 @@ if ((!isExtensionActive('sponsor'))) { } // END - if // Create array for form errors (= missing data) -$formErrors = array(); +$formErrors = []; if (isFormSent()) { // diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 4c63a5ae9e..33a31d53ff 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -83,7 +83,7 @@ switch (strtoupper($do)) { $female = countSumTotalData('F', 'user_data', 'userid', 'gender', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'")); // List every month - $months = array(); + $months = []; for ($idx = 1; $idx < 13; $idx++) { // Copy it so we don't touch the for() loop index $month = $idx; @@ -101,7 +101,7 @@ switch (strtoupper($do)) { $result = sqlQuery("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `visible`='Y' ORDER BY `id` ASC", __FILE__, __LINE__); // Load categories first - $cats = array(); $cat_cnt = array(); + $cats = []; $cat_cnt = []; // @TODO This can be somehow rewritten while ($content = sqlFetchArray($result)) { diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index ea1384513e..8a72423d6d 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -44,7 +44,7 @@ if ((!isExtensionActive('top10')) && (!isAdmin())) { } // END - if // Init array -$rows = array(); +$rows = []; // TOP logins $result = sqlQuery("SELECT diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index 404945d9c1..fe04644abb 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -51,7 +51,7 @@ if ((!isExtensionActive('holiday')) && (!isAdmin())) { } // END - if // Init content array -$content = array(); +$content = []; // Check for running mail orders in pool $result1 = sqlQueryEscaped("SELECT diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 27ec77bc17..1cacc010b5 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -51,7 +51,7 @@ if ((!isExtensionActive('mydata')) && (!isAdmin())) { } // END - if // Add userid -$content = array(); +$content = []; // Init variable to prevent notices $url = ''; diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 7efc8cb41f..fbc5b0c36e 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -152,7 +152,7 @@ ORDER BY // Are there still receivers left? if (sqlNumRows($result) >= postRequestElement('receiver')) { // Load receivers from database - $receiverArray = array(); $count = '0'; + $receiverArray = []; $count = '0'; while ($holidayContent = sqlFetchArray($result)) { // Run fetched data through pre filter chain $holidayContent = runFilterChain('pre_mail_recipient_check', $holidayContent); @@ -291,9 +291,9 @@ ORDER BY if ($totalPoints > 0) { // Initialize array... $categories = array( - 'id' => array(), - 'name' => array(), - 'userids' => array() + 'id' => [], + 'name' => [], + 'userids' => [] ); // Enable HTML checking @@ -358,7 +358,7 @@ ORDER BY // Now we need to load the mail types... $result = sqlQuery("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `price` > 0 AND `payment` > 0 ORDER BY `payment` ASC", __FILE__, __LINE__); - $payments = array(); + $payments = []; if (!ifSqlHasZeroNumRows($result)) { // Is the error code set? if (isGetRequestElementSet('code')) { diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index 82139ab1b6..c9565dfa73 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { addYouAreHereLink('member', __FILE__); // Init output -$main_content = array(); +$main_content = []; // Load waiting/pending orders $result = sqlQueryEscaped("SELECT diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index 762b64dc6f..871c5a2dfb 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -70,12 +70,12 @@ if (isPostRequestElementSet('member_theme')) { // Initialize array $themes = array( - 'theme_unix' => array(), // Unix name from filesystem - 'theme_name' => array(), // Title - 'theme_author' => array(), // Theme author's name - 'theme_email' => array(), // Author's email address - 'theme_url' => array(), // URL were you can download it from - 'theme_version' => array(), // Version number of theme + 'theme_unix' => [], // Unix name from filesystem + 'theme_name' => [], // Title + 'theme_author' => [], // Theme author's name + 'theme_email' => [], // Author's email address + 'theme_url' => [], // URL were you can download it from + 'theme_version' => [], // Version number of theme ); // Read directory "themes" diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 05c74f57ea..4e39517d7c 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -163,7 +163,7 @@ if (!ifSqlHasZeroNumRows($result)) { $sum = '0'; $OUT = ''; // Init content - $content = array(); + $content = []; // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() while ($row = sqlFetchArray($result)) { diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 10fae46447..bf7085a0b2 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -59,7 +59,8 @@ if ((getWernisApiId() == '') || (getWernisApiMd5() == '')) { } // END - if // Init the content array and points -$content = array(); $points = FALSE; +$content = []; +$points = FALSE; // Is the mode set (withdraw or payout) if ((!isGetRequestElementSet('do')) || (getRequestElement('do') == 'choose')) { diff --git a/inc/phpmailer/examples/images/phpmailer.png b/inc/phpmailer/examples/images/phpmailer.png index abe0101f36b3f0b3aac2362b546255e5c79fc9d3..a2f8b020a495e9b0bd98313ea0eda051017e32a2 100644 GIT binary patch delta 13 Ucmdlay-}K_Gr-S%BkNjT03i_sd;kCd delta 14 Vcmdley-Aw2Gr-TCcO%PMUH~Lx1c?9u diff --git a/inc/phpmailer/test/test.png b/inc/phpmailer/test/test.png index 02de5a7aa3507dcec1e4349520ba3e8d8f7da4d6..a6e76bbdd42a0e9cddf2ce1f2bd0feac7ea0bde0 100644 GIT binary patch delta 13 UcmZqR`p?PI8Q|x>k@YtV03h@Px&QzG delta 14 Vcmey**}%ox8Q|y6yOHHL3jifO1jhgX diff --git a/inc/pool-functions.php b/inc/pool-functions.php index 7b08581e61..1c4ea0f872 100644 --- a/inc/pool-functions.php +++ b/inc/pool-functions.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { // @TODO "Hook" ext-html_mail into this to allow column `html_msg` function getPoolDataFromId ($poolId) { // Init content array - $content = array(); + $content = []; // Search for pool data $result = sqlQueryEscaped('SELECT diff --git a/inc/pool/pool-bonus.php b/inc/pool/pool-bonus.php index c4f3ef3480..4c904ee535 100644 --- a/inc/pool/pool-bonus.php +++ b/inc/pool/pool-bonus.php @@ -94,7 +94,7 @@ ORDER BY array(bigintval($mailData['id'])), __FILE__, __LINE__); // Default is no users left - $receivers = array(); + $receivers = []; // "Explode" all receivers into an array if (isInString(';', $mailData['receivers'])) { diff --git a/inc/purge/purge-coupon.php b/inc/purge/purge-coupon.php index 46b3380a54..a0ff3bb190 100644 --- a/inc/purge/purge-coupon.php +++ b/inc/purge/purge-coupon.php @@ -63,7 +63,7 @@ ORDER BY if (sqlNumRows($result) > 0) { // Init variables $out = ''; - $ids = array(); + $ids = []; // Start purging all while ($content = sqlFetchArray($result)) { diff --git a/inc/purge/purge-inact.php b/inc/purge/purge-inact.php index 900638851d..250ed37cd0 100644 --- a/inc/purge/purge-inact.php +++ b/inc/purge/purge-inact.php @@ -53,7 +53,7 @@ if (isAutopurgeInactiveEnabled()) { // Init userid exclusion $excludeSql = ''; - $excludedUserids = runFilterChain('config_userid_exclusion_sql', array()); + $excludedUserids = runFilterChain('config_userid_exclusion_sql', []); if (isFilledArray($excludedUserids)) { // Exclude all $excludeSql = ' AND `userid` NOT IN (' . implode(', ', $excludedUserids) . ')'; @@ -77,7 +77,7 @@ ORDER BY if (!ifSqlHasZeroNumRows($result_inactive)) { // Prepare variables and constants... - $userids = array(); + $userids = []; $content['since'] = (getApInactiveSince() / 60 / 60); $content['time'] = (getApInactiveTime() / 60 / 60); @@ -134,7 +134,7 @@ ORDER BY if (!ifSqlHasZeroNumRows($result_inactive)) { // Prepare userid array for admin... - $userids = array(); + $userids = []; // Delete inactive accounts while ($content = sqlFetchArray($result_inactive)) { diff --git a/inc/purge/purge-tasks.php b/inc/purge/purge-tasks.php index b8aa028d02..40c5fc4c97 100644 --- a/inc/purge/purge-tasks.php +++ b/inc/purge/purge-tasks.php @@ -68,7 +68,7 @@ ORDER BY // Send out a notification? if (!ifSqlHasZeroNumRows($result)) { // Init output and load all rows - $output = ''; $ids = array(); + $output = ''; $ids = []; while ($row = sqlFetchArray($result)) { // "Translate" creation timestamp $row['task_created'] = generateDateTime($row['task_created'], '1'); diff --git a/inc/referral-functions.php b/inc/referral-functions.php index c2a616ebf3..a64915e94d 100644 --- a/inc/referral-functions.php +++ b/inc/referral-functions.php @@ -381,7 +381,7 @@ function subtractPoints ($subject, $userid, $points) { function getUserReferralPoints ($userid, $level) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!'); // Default is no refs and no nickname - $refs = array(); + $refs = []; // Get refs from database $result = sqlQueryEscaped('SELECT @@ -577,7 +577,7 @@ function updateReferralTable ($userid) { function loadReferralTable ($userid) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!'); // Init array - $GLOBALS['referral_refid'][$userid] = array(); + $GLOBALS['referral_refid'][$userid] = []; // Get all level entries from the refsystem table $GLOBALS['referral_result'][$userid] = sqlQueryEscaped('SELECT `level` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s ORDER BY `level` ASC', @@ -590,7 +590,7 @@ function loadReferralTable ($userid) { while (list($level) = sqlFetchRow($GLOBALS['referral_result'][$userid])) { // Init array //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level); - $GLOBALS['referral_refid'][$userid][$level] = array(); + $GLOBALS['referral_refid'][$userid][$level] = []; // Level is = 1? if ($level == 1) { @@ -738,10 +738,10 @@ function generatePointsLockedModeOptions ($lockedMode = NULL) { 'LOCKED', 'UNLOCKED' ), - array(), + [], $lockedMode, '', '', - array(), + [], 'translatePointsLockedMode' ); } // END - if @@ -761,10 +761,10 @@ function generatePointsPaymentMethodOptions ($paymentMethod = NULL) { 'DIRECT', 'REFERRAL' ), - array(), + [], $paymentMethod, '', '', - array(), + [], 'translatePointsPaymentMethod' ); } // END - if @@ -784,10 +784,10 @@ function generatePointsNotifyRecipientOptions ($notifyRecipient = NULL) { 'Y', 'N' ), - array(), + [], $notifyRecipient, '', '', - array(), + [], 'translatePointsNotifyRecipient' ); } // END - if diff --git a/inc/sql-functions.php b/inc/sql-functions.php index b56d0dfca8..ecd6fb1cff 100644 --- a/inc/sql-functions.php +++ b/inc/sql-functions.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { // Init SQLs array function initSqls () { // Init generic array - setSqlsArray(array('generic' => array())); + setSqlsArray(array('generic' => [])); } // Checks whether the sqls array is initialized @@ -719,7 +719,7 @@ function getLastSqlError () { // Gets an array (or false if none is found) from all supported engines function getArrayFromSupportedSqlEngines ($requestedEngine = 'ALL') { // Init array - $engines = array(); + $engines = []; // This also worked, now we need to check if the selected database type is supported $result = sqlQuery('SHOW ENGINES', __FUNCTION__, __LINE__); diff --git a/inc/stats-functions.php b/inc/stats-functions.php index b4fd58326d..0fe7647747 100644 --- a/inc/stats-functions.php +++ b/inc/stats-functions.php @@ -40,7 +40,7 @@ function initStatsSystem () { // Is stats cache loaded? if ((!isset($GLOBALS['stats_loaded'])) && (ifInternalStatsEnabled())) { // Init statistics array - $GLOBALS['stats'] = array(); + $GLOBALS['stats'] = []; // Load statistics entry from temporary table loadStatsTable(); diff --git a/inc/template-functions.php b/inc/template-functions.php index d08805fa50..1cc687b0f6 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -238,7 +238,7 @@ function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) // Compile all out while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($totalCompilations < 7)) { // Init common variables - $content = array(); + $content = []; $newContent = ''; // Compile it @@ -293,7 +293,7 @@ function outputRawCode ($htmlCode) { } // Load a template file and return it's content (only it's name; do not use ' or ") -function loadTemplate ($template, $return = FALSE, $content = array(), $compileCode = TRUE) { +function loadTemplate ($template, $return = FALSE, $content = [], $compileCode = TRUE) { // @TODO Remove these sanity checks if all is fine if (!is_bool($return)) { // $return has to be boolean @@ -477,7 +477,7 @@ function detectExtraTemplatePath ($prefix, $template) { } // Loads an email template and compiles it -function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = TRUE) { +function loadEmailTemplate ($template, $content = [], $userid = NULL, $loadUserData = TRUE) { // Make sure all template names are lowercase! $template = strtolower($template); @@ -685,7 +685,7 @@ function compileRawCode ($code, $full = TRUE, $compileCode = TRUE) { // Are some matches found? if ((isFilledArray($matches)) && (isFilledArray($matches[0]))) { // Replace all matches - $matchesFound = array(); + $matchesFound = []; foreach ($matches[0] as $key => $match) { // Fuzzy look has failed by default $fuzzyFound = FALSE; @@ -2058,7 +2058,7 @@ function generateGenderSelectionBox ($selectedGender = '', $fieldName = 'gender' // Generates a selection box for given default value function generateTimeUnitSelectionBox ($defaultUnit, $fieldName, $unitArray) { // Init variables - $messageIds = array(); + $messageIds = []; // Generate message id array foreach ($unitArray as $unit) { @@ -2275,7 +2275,7 @@ function doTemplateGuestFooterExtras ($templateName, $clear) { // Name of used template 'template' => $templateName, // Target array for gathered data - '__data' => array(), + '__data' => [], // Where the HTML output will go '__output' => '', ); @@ -2302,7 +2302,7 @@ function doTemplateMemberFooterExtras ($templateName, $clear) { // Name of used template 'template' => $templateName, // Target array for gathered data - '__data' => array(), + '__data' => [], // Where the HTML output will go '__output' => '', ); @@ -2398,7 +2398,7 @@ function doTemplateDereferrerUrl ($templateName, $clear = FALSE, $url = NULL) { } // Load another template and return its content -function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = array()) { +function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = []) { // Load "the" template return loadTemplate($theTemplate, TRUE, $content); } diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 4ac0eeeffb..0fd8edd6c9 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1043,7 +1043,7 @@ function initUserData () { // Init the user unset($GLOBALS['is_userdata_valid'][getCurrentUserId()]); - $GLOBALS['user_data'][getCurrentUserId()] = array(); + $GLOBALS['user_data'][getCurrentUserId()] = []; } // Getter for user data @@ -1095,7 +1095,7 @@ function getUserDataArray () { return $GLOBALS['user_data'][$userid]; } else { // Return empty array - return array(); + return []; } } @@ -3144,7 +3144,7 @@ function parseFloat ($floatString){ function search_array ($array, $key, $value, $parentIndex = NULL) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'array(' . count($array) . ')=' . print_r($array, TRUE) . ',key=' . $key . ',value=' . $value . ',parentIndex[' . gettype($parentIndex) . '=' . $parentIndex . ' - ENTERED!'); // Init array result - $results = array(); + $results = []; // Is $array really an array? if (is_array($array)) { @@ -3349,7 +3349,7 @@ function prependZeros ($str, $length = 2) { // Wraps convertSelectionsToEpocheTime() function convertSelectionsToEpocheTimeInPostData ($id) { // Init variables - $content = array(); + $content = []; $skip = FALSE; // Get all POST data @@ -3479,7 +3479,7 @@ function loadAllExtensionsByTemplate () { 'ext_', false, false, - array(), + [], '.tpl', '@(\.|\.\.)$@', false @@ -3569,7 +3569,7 @@ function convertApiResponseToArray ($responseString, $keyDelimiter, $valueDelimi $keys = explode($keyDelimiter, $responseString); // Init returned array and "walk" through all entries - $returned = array(); + $returned = []; foreach ($keys as $keyValue) { // Explode it $parts = explode($valueDelimiter, $keyValue); diff --git a/inc/xml-functions.php b/inc/xml-functions.php index ee135cfcc5..3302f8ab0c 100644 --- a/inc/xml-functions.php +++ b/inc/xml-functions.php @@ -51,7 +51,7 @@ function initXml () { } // Calls back a function based on given XML template data -function doGenericXmlTemplateCallback ($template, $content = array(), $compileCode = TRUE) { +function doGenericXmlTemplateCallback ($template, $content = [], $compileCode = TRUE) { // Init XML system as sch calls will be only used once per run initXml(); @@ -90,11 +90,11 @@ function doGenericXmlTemplateCallback ($template, $content = array(), $compileCo // Init main arrays $GLOBALS['__XML_CALLBACKS'] = array( - 'callbacks' => array(), - 'functions' => array() + 'callbacks' => [], + 'functions' => [] ); - $GLOBALS['__XML_ARGUMENTS'] = array(); - $GLOBALS['__COLUMN_INDEX'] = array(); + $GLOBALS['__XML_ARGUMENTS'] = []; + $GLOBALS['__COLUMN_INDEX'] = []; $GLOBALS['__XML_CONTENT'] = $content; // Handle it over to the parser diff --git a/theme/business/images/code_bg.png b/theme/business/images/code_bg.png index d7c5071e0983d783c245023c4614151b0f4aebb6..3fd11af919707a4c606cca0ae9adc395c9780c88 100644 GIT binary patch delta 13 UcmZn{XcJ)R4DfT`$jZb402;glU;qFB delta 14 VcmZn@Xcu7Z4DfU3-N?ek0RSDM18o2R diff --git a/theme/default/images/code_bg.png b/theme/default/images/code_bg.png index d7c5071e0983d783c245023c4614151b0f4aebb6..3fd11af919707a4c606cca0ae9adc395c9780c88 100644 GIT binary patch delta 13 UcmZn{XcJ)R4DfT`$jZb402;glU;qFB delta 14 VcmZn@Xcu7Z4DfU3-N?ek0RSDM18o2R diff --git a/theme/desert/images/code_bg.png b/theme/desert/images/code_bg.png index d7c5071e0983d783c245023c4614151b0f4aebb6..3fd11af919707a4c606cca0ae9adc395c9780c88 100644 GIT binary patch delta 13 UcmZn{XcJ)R4DfT`$jZb402;glU;qFB delta 14 VcmZn@Xcu7Z4DfU3-N?ek0RSDM18o2R diff --git a/theme/desert/images/help/bullet.png b/theme/desert/images/help/bullet.png index 8452736398fbf51673b142bf0143dd08cf4fc156..6b557d4e940f9bda47850b8b85e65afb89098013 100644 GIT binary patch delta 13 UcmdnRzLTA$Gr-S%BkNXX03aU(VgLXD delta 14 VcmdnVzKfl;Gr-TCcO%PIW&k5u1aANU diff --git a/theme/org/images/code_bg.png b/theme/org/images/code_bg.png index d7c5071e0983d783c245023c4614151b0f4aebb6..3fd11af919707a4c606cca0ae9adc395c9780c88 100644 GIT binary patch delta 13 UcmZn{XcJ)R4DfT`$jZb402;glU;qFB delta 14 VcmZn@Xcu7Z4DfU3-N?ek0RSDM18o2R diff --git a/theme/schleuder/images/code_bg.png b/theme/schleuder/images/code_bg.png index d7c5071e0983d783c245023c4614151b0f4aebb6..3fd11af919707a4c606cca0ae9adc395c9780c88 100644 GIT binary patch delta 13 UcmZn{XcJ)R4DfT`$jZb402;glU;qFB delta 14 VcmZn@Xcu7Z4DfU3-N?ek0RSDM18o2R diff --git a/theme/schleuder/images/help/bullet.png b/theme/schleuder/images/help/bullet.png index 8452736398fbf51673b142bf0143dd08cf4fc156..6b557d4e940f9bda47850b8b85e65afb89098013 100644 GIT binary patch delta 13 UcmdnRzLTA$Gr-S%BkNXX03aU(VgLXD delta 14 VcmdnVzKfl;Gr-TCcO%PIW&k5u1aANU diff --git a/theme/schleuder/images/menu/menu_title_online.jpg b/theme/schleuder/images/menu/menu_title_online.jpg index 9a1c062dd6dc305f5ae3feb716bbc70da87387fe..44b10c3543a6d41f8d04ff1f682aa417353b6288 100644 GIT binary patch delta 12 TcmcblaZzJK9{c8e_QyN`B>V+2 delta 14 VcmcbpaY