]> git.mxchange.org Git - mailer.git/commitdiff
Continued: 0.2.1-FINAL
authorRoland Häder <roland@mxchange.org>
Thu, 26 Dec 2024 03:05:57 +0000 (04:05 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 26 Dec 2024 03:05:57 +0000 (04:05 +0100)
- converted more old array() to "new" [] way

33 files changed:
inc/ajax/ajax_installer.php
inc/config-functions.php
inc/config-local.php.dist
inc/encryption-functions.php
inc/expression-functions.php
inc/filter-functions.php
inc/filter/cache_filter.php
inc/filters.php
inc/fixes/fix_menu.php
inc/gen_sql_patches.php
inc/general-functions.php
inc/init.php
inc/install-functions.php
inc/libs/network_functions.php
inc/libs/user_functions.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_holiday.php
inc/modules/admin/what-config_network.php
inc/modules/admin/what-config_order.php
inc/modules/admin/what-config_other.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-config_refid.php
inc/modules/admin/what-config_removeip.php
inc/modules/admin/what-config_stats.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-config_wernis.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_doubler.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-transfer.php
inc/template-functions.php
inc/wrapper-functions.php

index bb418ea129a5a9dbb3d9820bea451edea6f5c812..a285345fc0ed47775b7044c5bb5f4e9c87f2aa1e 100644 (file)
@@ -294,7 +294,7 @@ function doAjaxInstallerSaveChanges () {
        $currentTab = postRequestElement('tab');
 
        // Remove some elements which should not be saved
-       foreach (array('tab', 'do', 'level') as $removedElement) {
+       foreach (['tab', 'do', 'level'] as $removedElement) {
                // Remove this element from POST data
                unsetPostRequestElement($removedElement);
        } // END - foreach
@@ -749,7 +749,7 @@ function doAjaxInstallerStepWriteLocalConfig () {
 // Call-back function to register first admin
 function doAjaxInstallerStepRegisterFirstAdmin () {
        // Is all set?
-       if (!isSessionDataSet(array('admin_login', 'admin_email', 'admin_password1', 'admin_password2'))) {
+       if (!isSessionDataSet(['admin_login', 'admin_email', 'admin_password1', 'admin_password2'])) {
                // Some required session data is not set
                reportBug(__FUNCTION__, __LINE__, 'Required session data for this step not found.');
        } elseif (isAdminRegistered()) {
index 467ab1f2b1f62365e026d1b4e42a1c3736b5f3d7..389ba1b9aa9f23f683b2d1d9f449685053270ac0 100644 (file)
@@ -44,12 +44,13 @@ function initConfig () {
        } // END - if
 
        // Set a minimum of configuration, required to by-pass some error triggers in getConfig()
-       $GLOBALS['config'] = array(
+       $GLOBALS['config'] = [
                'sql_time'            => 0,
                'sql_count'           => 0,
                'num_templates'       => 0,
+               'DEBUG_MODE'          => 'N',
+               'verbose_sql'         => 'N',
                // 'DEFAULT_SALT_LENGTH' => 40,
-               // 'DEBUG_MODE'          => 'N',
                // 'DEBUG_HOURLY'        => 'N',
                // 'DEBUG_DAILY'         => 'N',
                // 'DEBUG_MONTHLY'       => 'N',
@@ -57,13 +58,12 @@ function initConfig () {
                // 'DEBUG_WEEKLY'        => 'N',
                // 'DEBUG_REGEX'         => 'N',
                // 'ADMIN_REGISTERED'    => 'N',
-               // 'verbose_sql'         => 'Y',
                // For installation phase:
                'SMTP_HOSTNAME'       => '',
                'SMTP_USER'           => '',
                'SMTP_PASSWORD'       => '',
                'MT_WORD'             => '{--DEFAULT_MT_WORD--}',
-       );
+       ];
 }
 
 // Getter for $GLOBALS['config'] entries
@@ -144,7 +144,7 @@ function getConfigArray () {
 function updateOldConfigFile () {
        // Watch out for these lines and execute them as single command
        // @TODO Make this all better... :-/
-       $watchLines = array(
+       $watchLines = [
                'SITE_KEY'         => 'SITE_KEY',
                'DEFAULT_LANG'     => 'DEFAULT_LANG',
                'warn_no_pass'     => 'WARN_NO_PASS',
@@ -167,13 +167,13 @@ function updateOldConfigFile () {
                'WEBMASTER'        => 'WEBMASTER',
                'PATH'             => 'PATH',
                'URL'              => 'URL',
-       );
+       ];
 
        // Make these lower-case! (damn stupid code...)
-       $lowerCase = array('WARN_NO_PASS', 'MAILER_INSTALLED', 'ADMIN_REGISTERED');
+       $lowerCase = ['WARN_NO_PASS', 'MAILER_INSTALLED', 'ADMIN_REGISTERED'];
 
        // Special comments...
-       $comments = array(
+       $comments = [
                'WARN_NO_PASS'       => 'NULLPASS-WARNING',
                'MAILER_INSTALLED  ' => 'INSTALLED',
                'ADMIN_REGISTERED'   => 'ADMIN-SETUP',
@@ -185,7 +185,7 @@ function updateOldConfigFile () {
                'dbase'              => 'MYSQL-DBASE',
                'login'              => 'MYSQL-LOGIN',
                'password'           => 'MYSQL-PASSWORD'
-       );
+       ];
 
        // Copy template to new file destionation
        copyFileVerified(getPath() . 'inc/config-local.php.dist', getCachePath() . 'config-local.php', 0644);
index 76f994b2ea00363dfcb674d8844d6b5e405051e6..344a3e303a4f62b003a61b9dd100d961eaf05a15 100644 (file)
@@ -109,7 +109,7 @@ setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N');
 //setConfigEntry('ALLOW_TESTER_ACCOUNTS', 'Y');
 
 // Your MySQL data (we don't like M$ SQL ;-) )
-$GLOBALS['mysql'] = array(
+$GLOBALS['mysql'] = [
        // CFG: MYSQL-HOST
        'host'     => 'localhost',
        // CFG: MYSQL-DBASE
@@ -118,7 +118,7 @@ $GLOBALS['mysql'] = array(
        'login'    => 'user',
        // CFG: MYSQL-PASSWORD
        'password' => 'pass',
-);
+];
 
 // SMTP-Subsystem (keep all empty to use legacy mail() command!)
 // CFG: SMTP-HOSTNAME
index fdd29ac56345ff8fb5ca42ea403d8e0edf318649..d2c2037d2b540f7e8b3b4e8adb581f844307b51b 100644 (file)
@@ -193,7 +193,7 @@ function getSupportedEncryptionAlgorithms () {
        $algos = mcrypt_list_algorithms();
 
        // Remove any unsecure (e.g. DES/3DES)
-       foreach (array('des', 'tripledes') as $unsecure) {
+       foreach (['des', 'tripledes'] as $unsecure) {
                // Search for it
                $id = array_search($unsecure, $algos, TRUE);
 
index 6b7711efff24b6a54149e20883be3b200cfd502d..3889586e40a5f27a7b47db7a3c7d09e8834c5da7 100644 (file)
@@ -428,7 +428,7 @@ function doExpressionForm ($data) {
        $data['__server']      = '';
 
        // Check which method/target is set
-       foreach (array('callback', 'extra_func', 'extra_func2') as $key) {
+       foreach (['callback', 'extra_func', 'extra_func2'] as $key) {
                // Make lower-case
                $value = strtolower($data[$key]);
 
@@ -474,7 +474,7 @@ function doExpressionForm ($data) {
        } // END - if
 
        // Add rest elements
-       foreach (array('method', 'target', 'name', 'id') as $key) {
+       foreach (['method', 'target', 'name', 'id'] as $key) {
                $data['__replacer'] .= ' ' . $key . '=\"' . $data['__form_' . $key] . '\"';
        } // END - foreach
 
index b3d70a7eb5c0c8e6d7a0dfa7ef463eadbfe1ed75..ac4a6520cd2b06fb76fa67c04d91af4cddbdc03d 100644 (file)
@@ -365,11 +365,11 @@ function prepareFilterArray () {
        } // END - if
 
        // Init dummy array
-       $filterArray = array(
+       $filterArray = [
                'chains'  => [],
                'loaded'  => [],
                'counter' => []
-       );
+       ];
 
        // Found in cache so rewrite the array
        foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) {
index 41549df5faa73d111c06daec0a3b3dcbb02f8d14..dc47a0362f703b0e05f9c58653e1cbf4be688941 100644 (file)
@@ -49,7 +49,7 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($filterData) {
        } // END - if
 
        // Remove cache
-       foreach (array('config', 'extension', 'filter', 'modules', 'earning', 'points_data') as $cache) {
+       foreach (['config', 'extension', 'filter', 'modules', 'earning', 'points_data'] as $cache) {
                // Rebuild cache
                rebuildCache($cache);
        } // END - foreach
@@ -84,7 +84,7 @@ function FILTER_CACHE_DESTROY_ALL ($filterData) {
        } // END - if
 
        // Remove cache files
-       foreach (array('admin', 'admin_acls', 'config', 'extension', 'earning', 'filter', 'imprint', 'modules', 'payments', 'points_data', 'refdepths', 'refsystem', 'themes') as $cache) {
+       foreach (['admin', 'admin_acls', 'config', 'extension', 'earning', 'filter', 'imprint', 'modules', 'payments', 'points_data', 'refdepths', 'refsystem', 'themes'] as $cache) {
                // Rebuild it
                rebuildCache($cache);
        } // END - foreach
index 7c418903a375895f0ec9219bc20f9c39648454a4..dc861739c3261478eba9e8f4bb4c2eb04c68b6c1 100644 (file)
@@ -880,7 +880,7 @@ function FILTER_RUN_YEARLY_RESET () {
 // Filter for loading more runtime includes (not for installation)
 function FILTER_LOAD_RUNTIME_INCLUDES () {
        // Load more includes
-       foreach (array('databases') as $inc) {
+       foreach (['databases'] as $inc) {
                // Load the include
                loadIncludeOnce('inc/' . $inc . '.php');
        } // END - foreach
index 006f856b2c4667f6c32dd2885be15f2c347437c4..4059f1c00575099ba23335db7a8181df2c351d5c 100644 (file)
@@ -36,7 +36,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Get all menus
-foreach (array('guest','member','admin') as $menu) {
+foreach (['guest','member','admin'] as $menu) {
        // Query it
        $result = sqlQueryEscaped("SELECT `action`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` ORDER BY `action` ASC,`what` ASC",
                array($menu), __FILE__, __LINE__);
index 846faa1e677c4bf4bd3bdb54b9371aa7b6d9c61c..ae187b3640e32515c31800088c457319352bc05a 100644 (file)
@@ -93,7 +93,7 @@ if ((getFileHash() == '') || (!isFileReadable(getGenericHashFileName()))) {
 // @TODO Rewrite this to a filter
 if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isValidCacheInstance())) {
        // Destroy some cache files
-       foreach (array('config', 'extension', 'filter', 'modules') as $cache) {
+       foreach (array['config', 'extension', 'filter', 'modules'] as $cache) {
                // Use rebuildCache()
                rebuildCache($cache);
        } // END - foreach
index 8508acc6c13414e3045db9f1a8aab7a6a68ce55b..c86ffa3ac9db8fbbdf46a3a1e7d1662e7d5a7262 100644 (file)
@@ -1595,7 +1595,7 @@ function convertSelectionsToEpocheTime (array &$postData, array &$content, &$id,
                        $GLOBALS['skip_config'][$test] = TRUE;
 
                        // Remove data from array
-                       foreach (array('ye', 'mo', 'mn', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
+                       foreach (['ye', 'mo', 'mn', 'we', 'da', 'ho', 'mi', 'se'] as $rem) {
                                unset($postData[$test . '_' . $rem]);
                        } // END - foreach
 
@@ -2239,7 +2239,7 @@ function handleFieldWithBraces ($field) {
                 * Try to find one and replace it. I do it this way to allow easy
                 * extending of this code.
                 */
-               foreach (array('admin_list_builder_id_value') as $key) {
+               foreach (['admin_list_builder_id_value'] as $key) {
                        /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key);
                        // Is the cache entry set?
                        if (isset($GLOBALS[$key])) {
index c46410b0c2f311dd6f888e47d78543c867f7a696..f6710b8fa72f8a9427d628227cf2d1e31858e155 100644 (file)
@@ -58,8 +58,8 @@ if (function_exists('import_request_variables')) {
 $path = str_replace(chr(92), '/', substr(dirname(__FILE__), 0, -3));
 
 // Some very important function includes
-foreach (array('config', 'wrapper', 'template', 'module', 'inc', 'http', 'general') as $inc) {
-       include($path . 'inc/' . $inc . '-functions.php');
+foreach (['config', 'wrapper', 'template', 'module', 'inc', 'http', 'general'] as $inc) {
+       include sprintf('%sinc/%s-functions.php', $path, $inc);
 } // END - foreach
 
 // Initialize application
index ef4a75edcc481bbbd96e21a0584a7bc0151bee0e..9d9db66774e3e3f5116402d04ae220d8bc488c0d 100644 (file)
@@ -38,7 +38,7 @@ if ((!defined('__SECURITY')) || (!isInstaller())) {
 // Init installer
 function initInstaller () {
        // Initialize installer group array
-       $GLOBALS['installer_groups'] = array(
+       $GLOBALS['installer_groups'] = [
                // base_data
                'base_path'       => 'base_data',
                'base_url'        => 'base_data',
@@ -68,7 +68,7 @@ function initInstaller () {
                'admin_email'     => 'first_admin',
                'admin_password1' => 'first_admin',
                'admin_password2' => 'first_admin',
-       );
+       ];
 
        // Set mininmum password length/score and other config entries
        setConfigEntry('min_password_length', 5);
@@ -125,7 +125,7 @@ function doInstallerBootstrap () {
        initSession();
 
        // Include more
-       foreach (array('databases', 'install-functions', 'load_config', 'load_cache') as $inc) {
+       foreach (['databases', 'install-functions', 'load_config', 'load_cache'] as $inc) {
                // Load include file
                loadIncludeOnce('inc/' . $inc . '.php');
        } // END - foreach
index 236c7ea2ff42d0794580e9cb8ee3b8638c1ddaad..a8f0d3f87725930ab1e65d1bae323a0cb270d30a 100644 (file)
@@ -78,7 +78,7 @@ function detectNetworkProcessForm () {
        setNetworkFormName('invalid');
 
        // Now search all valid
-       foreach (array('save_config', 'add', 'edit', 'delete', 'do_edit', 'do_delete') as $formName) {
+       foreach (['save_config', 'add', 'edit', 'delete', 'do_edit', 'do_delete'] as $formName) {
                // Is it detected
                if (isFormSent($formName)) {
                        // Use this form name
@@ -2493,7 +2493,7 @@ function doAdminNetworkProcessNetworkApiConfig () {
        setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 
        // NULL empty values
-       foreach (array('network_api_site_id', 'network_api_referral_button', 'network_api_visual_pay_check') as $key) {
+       foreach (['network_api_site_id', 'network_api_referral_button', 'network_api_visual_pay_check'] as $key) {
                // Is it set?
                if (!isPostRequestElementSet($key)) {
                        // Remove empty value to get a NULL for an optional entry
@@ -2541,7 +2541,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE, $co
         * Some parameters are optional, at least one must be given so check a bunch
         * of parameters.
         */
-       foreach (array('network_min_waiting_time', 'network_max_waiting_time', 'network_min_remain_budget', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic', 'network_media_size', 'network_media_output') as $element) {
+       foreach (['network_min_waiting_time', 'network_max_waiting_time', 'network_min_remain_budget', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic', 'network_media_size', 'network_media_output'] as $element) {
                // Is this element empty?
                if (!isPostRequestElementSet($element)) {
                        // Then unset it to get a NULL for optional parameter
@@ -2637,7 +2637,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE, $c
         * Some parameters are optional, at least one must be given so check a bunch
         * of parameters.
         */
-       foreach (array('network_min_waiting_time', 'network_max_waiting_time', 'network_min_remain_budget', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic', 'network_media_size', 'network_media_output') as $element) {
+       foreach (['network_min_waiting_time', 'network_max_waiting_time', 'network_min_remain_budget', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic', 'network_media_size', 'network_media_output'] as $element) {
                // Is this element empty?
                if (!isPostRequestElementSet($element)) {
                        // Then unset it to get a NULL for optional parameter
index 99b5770f323a40aa25b4e2450231867dbe4e4206..9c69efafde54d6cf713ea1a9ae0dbada981f938e 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 // Add links for selecting some users
 function addAlphabeticalSorting ($sortby) {
        $add = '';
-       foreach (array('page', 'offset', 'do', 'status') as $param) {
+       foreach (['page', 'offset', 'do', 'status'] as $param) {
                if (isGetRequestElementSet($param)) {
                        $add .= '&amp;' . $param . '=' . getRequestElement($param);
                } // END - if
@@ -93,7 +93,7 @@ function addSortLinks ($letter, $sortby) {
        $add = '&amp;page=' . getRequestElement('page') . '&amp;offset=' . getRequestElement('offset');
 
        // Add status/ mode
-       foreach (array('do','status') as $param) {
+       foreach (['do','status'] as $param) {
                if (isGetRequestElementSet($param)) {
                        $add .= '&amp;' . $param . '=' . getRequestElement($param);
                } // END - if
@@ -154,7 +154,7 @@ function addPageNavigation ($numPages) {
                                $OUT .= '<a href="{%url=modules.php?module=admin&amp;what=' . getWhat();
 
                                // Add status/mode
-                               foreach (array('do','status') as $param) {
+                               foreach (['do','status'] as $param) {
                                        if (isGetRequestElementSet($param)) {
                                                $OUT .= '&amp;' . $param . '=' . getRequestElement($param);
                                        } // END - if
index 0b38c93e7026d9565830a256e74b5ed5fd4eefb0..f09f6a5121efa0ea885faf3aca27d5c14299132a 100644 (file)
@@ -62,7 +62,7 @@ if (isFormSent('save_config')) {
        $content['wait_selection']   = createConfigurationTimeSelections('beg_notify_wait'   , 'ms' );
 
        // Init elements for faker-mode
-       foreach (array('pay_mode_img', 'pay_mode_js', 'pay_mode_both', 'pay_mode_none') as $entry) {
+       foreach (['pay_mode_img', 'pay_mode_js', 'pay_mode_both', 'pay_mode_none'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index e40339be5273f99aa4930975b409abd542132dcf..4b84ab4ee6c2ce3acded0e8eb4f75b553669da7e 100644 (file)
@@ -51,12 +51,12 @@ if (isFormSent('save_config')) {
        adminSaveSettingsFromPostData();
 } else {
        // Init other selections
-       foreach (array('send_mode_direct','send_mode_reset') as $entry) {
+       foreach (['send_mode_direct', 'send_mode_reset'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
        // Set current selections
-       foreach (array('send_mode') as $entry) {
+       foreach (['send_mode'] as $entry) {
                $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
        } // END - foreach
 
@@ -64,10 +64,10 @@ if (isFormSent('save_config')) {
        $content['doubler_userid'] = addMemberSelectionBox(getDoublerUserid(), FALSE, TRUE, TRUE, 'doubler_userid');
 
        // Number of rows to display (option lines!!!)
-       foreach (array('new','pay','old') as $entry) {
+       foreach (['new', 'pay', 'old'] as $entry) {
                $content['display_' . $entry] = generateOptions(
                        '/ARRAY/',
-                       array(
+                       [
                                5,
                                10,
                                20,
@@ -75,7 +75,7 @@ if (isFormSent('save_config')) {
                                40,
                                50,
                                100
-                       ), array(
+                       ], [
                                5,
                                10,
                                20,
@@ -83,7 +83,7 @@ if (isFormSent('save_config')) {
                                40,
                                50,
                                100
-                       ),
+                       ],
                        getConfig('doubler_display_' . $entry)
                );
        } // END - foreach
index 5b08c59b675cd9eb11c02feae9b14e5e9afc13eb..611d48cf1067a401d7486c27af8eccd5409a923f 100644 (file)
@@ -51,7 +51,7 @@ if (isFormSent('save_config')) {
        $content['holiday_lock'] = createConfigurationTimeSelections('holiday_lock', 'WDh');
 
        // Init all entries
-       foreach (array('holiday_mode_direct','holiday_mode_reset') as $entry) {
+       foreach (['holiday_mode_direct', 'holiday_mode_reset'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index 77bc0c5b9a1224cec9c78c48958f2920ccc75d75..b0550735442bfb0f306229c1ef5b70403e64337b 100644 (file)
@@ -52,7 +52,7 @@ if (isFormSent('save_config')) {
        $content['network_logging_purge'] = createConfigurationTimeSelections('network_logging_purge', 'WDh');
 
        // Init Y/N selections
-       foreach (array('network_logging_debug') as $key) {
+       foreach (['network_logging_debug'] as $key) {
                $content[$key . '_y'] = '';
                $content[$key . '_n'] = '';
        } // END - foreach
index f7afd72126cccb4cb3d3f9a4a5518f1f16d45874..d200c7291d4adcee298cecd62af21505213ade15 100644 (file)
@@ -48,7 +48,7 @@ if (isFormSent('save_config')) {
        adminSaveSettingsFromPostData();
 } else {
        // Init all selection entries
-       foreach (array('order_max_full_order', 'order_max_full_max', 'order_mode_asc', 'order_mode_desc', 'repay_deleted_mails_repay', 'repay_deleted_mails_jackpot', 'repay_deleted_mails_shred') as $entry) {
+       foreach (['order_max_full_order', 'order_max_full_max', 'order_mode_asc', 'order_mode_desc', 'repay_deleted_mails_repay', 'repay_deleted_mails_jackpot', 'repay_deleted_mails_shred'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index 80cba1720e43e94d0c34b1e77b61e7fb9e5183d5..e55fdc2fc184c9deeb03fbb85070edfb0d01b85b 100644 (file)
@@ -70,7 +70,7 @@ if (isFormSent('save_config')) {
        $content['url_tlock']        = createConfigurationTimeSelections('url_tlock'            , 'WDh');
 
        // Prepare more
-       foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) {
+       foreach (['css_php_direct', 'css_php_file', 'css_php_inline', 'mailid_error_redirect_index', 'mailid_error_redirect_reject'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index c5891b503a02539fdc7734ddbd44c264dca12f26..bc09abea7a9418235ec50e16eac547d46d5994b7 100644 (file)
@@ -122,7 +122,7 @@ WHERE
 } elseif (getRequestElement('sub') == 'settings') {
        // Setup some settings like direct pay and so on
        // Including new add-mode for one-time referral bonus
-       foreach (array('allow_direct_pay') as $entry) {
+       foreach (['allow_direct_pay'] as $entry) {
                $content[$entry . '_y'] = '';
                $content[$entry . '_n'] = '';
                $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
index e05a39bafe643abe2c73baeb17b19f301a42bb99..ea47b0702b2770cb1b3ba61668eb583f0e8fea73 100644 (file)
@@ -51,7 +51,7 @@ if (isFormSent('save_config')) {
        $content['def_refid'] = addMemberSelectionBox(getDefRefid(), FALSE, TRUE, TRUE, 'def_refid');
 
        // Prepare contants for the template
-       foreach (array('refid_target_index','refid_target_register','select_user_zero_refid_y','select_user_zero_refid_n') as $entry) {
+       foreach (['refid_target_index', 'refid_target_register', 'select_user_zero_refid_y', 'select_user_zero_refid_n'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index b2fa5ae532a0f5f0d52a82df5dd44dcd643523f5..26e54d1f5dbfc2645070471cae09606b642f7157 100644 (file)
@@ -48,7 +48,7 @@ if (isFormSent('save_config')) {
        adminSaveSettingsFromPostData();
 } else {
        // Prepare more entries
-       foreach (array('anonymous_ip_local','anonymous_ip_zero','anonymous_ip_random') as $entry) {
+       foreach (['anonymous_ip_local','anonymous_ip_zero','anonymous_ip_random'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index e31db500e381289b493cece911d5dd5a670c60d6..787fc79ac45d82dd1c01b521b433104d067c78ff 100644 (file)
@@ -49,7 +49,7 @@ if (isFormSent('save_config')) {
        adminSaveSettingsFromPostData();
 } else {
        // Guest stats
-       foreach (array('members','modules','inactive') as $entry) {
+       foreach (['members', 'modules', 'inactive'] as $entry) {
                $content['guest_stats_' . $entry] = '';
        } // END - foreach
 
index b9907bd60c891319dc4d1d6ee64fadf5e357047a..9971a8a4ba388fc16f849987fd687ad7b883e771 100644 (file)
@@ -52,7 +52,7 @@ if (isFormSent('save_config')) {
        adminSaveSettingsFromPostData();
 } else {
        // Prepare content
-       $content = array(
+       $content = [
                'surfbar_static_time'     => createConfigurationTimeSelections('surfbar_static_time'   , 'ms' , 'left'),
                'surfbar_static_lock'     => createConfigurationTimeSelections('surfbar_static_lock'   , 'hm' , 'left'),
                'surfbar_restart_time'    => createConfigurationTimeSelections('surfbar_restart_time'  , 'ms' , 'left'),
@@ -60,10 +60,10 @@ if (isFormSent('save_config')) {
                'surfbar_purge_deleted'   => createConfigurationTimeSelections('surfbar_purge_deleted' , 'WDh', 'left'),
                'surfbar_purge_migrated'  => createConfigurationTimeSelections('surfbar_purge_migrated', 'WDh', 'left'),
                'surfbar_low_interval'    => createConfigurationTimeSelections('surfbar_low_interval'  , 'WDh', 'left'),
-       );
+       ];
 
        // Even some more...
-       foreach (array('surfbar_payment_model_static','surfbar_payment_model_dynamic','surfbar_pause_mode_internal','surfbar_pause_mode_external','surfbar_notification_mode_instant','surfbar_notification_mode_reset') as $entry) {
+       foreach (['surfbar_payment_model_static','surfbar_payment_model_dynamic','surfbar_pause_mode_internal','surfbar_pause_mode_external','surfbar_notification_mode_instant','surfbar_notification_mode_reset'] as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
index 95b848394f753b7e7c5d64f80ae5e517592a3c04..9db3e4d06e3d88086fc694ac477f8827d688d37d 100644 (file)
@@ -56,7 +56,7 @@ if (isFormSent('save_config')) {
                // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
                if (doAdminTestWernisApi()) {
                        // Revert german commata
-                       foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
+                       foreach (['payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent'] as $revert) {
                                setPostRequestElement('wernis_' . $revert, postRequestElement('wernis_' . $revert));
                        } // END - if
 
index 79861ba7404836b95d90906e583d69c5d7b80035..9b095c1f24bcfd45c62ab7bce9f0d1b06af07ec9 100644 (file)
@@ -366,7 +366,7 @@ ORDER BY
                                                // @TODO Rewrite this to a filter
                                                if (isExtensionActive('cache')) {
                                                        // Remove cache file (will be auto-created again!)
-                                                       foreach (array('config', 'extension', 'filter', 'modules') as $cache) {
+                                                       foreach (['config', 'extension', 'filter', 'modules'] as $cache) {
                                                                // Rebuild cache file
                                                                rebuildCache($cache);
                                                        } // END - foreach
index deec39ab5551b27ff41b35a6a4f7bc916084d786..467a33405849b6003927c8d739bb267bd5a0cd03 100644 (file)
@@ -63,7 +63,7 @@ switch (getRequestElement('do')) {
 
        case 'overview': // General overview page
                // Prepare links
-               foreach (array('already_direct','already_ref','waiting_direct','waiting_ref') as $entry) {
+               foreach (['already_direct', 'already_ref', 'waiting_direct', 'waiting_ref'] as $entry) {
                        $content[$entry . '_link'] = '0';
                } // END - switch
 
index ba371e625b87ce2abe4256331ae99e2f81e8bfa5..d9fdcc2e101688c274a449d7f55d9f5677a4cc3e 100644 (file)
@@ -254,14 +254,14 @@ ORDER BY
                $content['payment_list'] = loadTemplate('guest_sponsor_payment', TRUE, $OUT);
 
                // Init a lot array elements
-               foreach (array('company','position','tax_ident','sex_m','sex_f','sex_c','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url','receive_warnings_y','receive_warnings_n','form_errors','refid') as $entry) {
+               foreach (['company', 'position', 'tax_ident', 'sex_m', 'sex_f', 'sex_c', 'surname', 'family', 'street_nr1', 'street_nr2', 'country', 'zip', 'city', 'phone', 'fax', 'cell', 'email', 'url', 'receive_warnings_y', 'receive_warnings_n', 'form_errors', 'refid'] as $entry) {
                        $content[$entry]   = '';
                } // END - foreach
 
                // Check for invalid entries
                if (isFilledArray($formErrors)) {
                        // Some found... :-(
-                       foreach (array('company','position','tax_ident','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url') as $entry) {
+                       foreach (['company', 'position', 'tax_ident', 'surname', 'family', 'street_nr1', 'street_nr2', 'country', 'zip', 'city', 'phone', 'fax', 'cell', 'email', 'url'] as $entry) {
                                $content[$entry]    = postRequestElement($entry);
                        } // END - foreach
 
index a83d17fea2f43b67352023791753a98367e67313..46052988e87dd42ef39a3bb50f984aa91f9c3ade 100644 (file)
@@ -473,7 +473,7 @@ INDEX (`party_userid`)
                } // END - if
 
                // Init entries
-               foreach (array('allow_y','allow_n') as $entry) {
+               foreach (['allow_y','allow_n'] as $entry) {
                        $content[$entry] = '';
                } // END - foreach
 
index c081c43a6c52ee7b7bc130996a0033868e02b9c6..159456c0bdb4b0e53e383caa3ec7951014371469 100644 (file)
@@ -1026,7 +1026,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
        } // END - if
 
        // Put all calculated values in array
-       $data = array(
+       $data = [
                'Y' => $year,
                'M' => $month,
                'W' => $week,
@@ -1034,7 +1034,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                'h' => $hour,
                'm' => $minute,
                's' => $second
-       );
+       ];
 
        //
        // Now we convert them in seconds...
@@ -1044,9 +1044,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                $OUT = $data;
        } else {
                // Init array
-               $units = array(
+               $units = [
                        // Time unit -> field name
-                       'unit_field' => array(
+                       'unit_field' => [
                                'Y' => 'ye',
                                'M' => 'mn',
                                'W' => 'we',
@@ -1054,9 +1054,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                                'h' => 'ho',
                                'm' => 'mi',
                                's' => 'se'
-                       ),
+                       ],
                        // Time unit -> label
-                       'unit_label' => array(
+                       'unit_label' => [
                                'Y' => 'YEAR',
                                'M' => 'MONTH',
                                'W' => 'WEEK',
@@ -1064,8 +1064,8 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                                'h' => 'HOUR',
                                'm' => 'MINUTE',
                                's' => 'SECOND'
-                       )
-               );
+                       ]
+               ];
 
                // Generate table
                $OUT  = '<div align="' . $align . '">';
@@ -1265,10 +1265,10 @@ function displayParsingTime () {
 
        // Prepare output
        // @TODO This can be easily moved out after the merge from EL branch to this is complete
-       $content = array(
+       $content = [
                'run_time' => $runTime,
                'sql_time' => (getConfig('sql_time') * 1000),
-       );
+       ];
 
        // Load the template
        $GLOBALS['__page_footer'] .= loadTemplate('show_timings', TRUE, $content);
@@ -1333,10 +1333,10 @@ function reportBug ($file, $line, $message = '', $sendEmail = TRUE) {
        // Send an email? (e.g. not wanted for evaluation errors)
        if (($sendEmail === TRUE) && (!isInstaller()) && (isAdminRegistered())) {
                // Prepare content
-               $content = array(
+               $content = [
                        'message'   => trim($message),
                        'backtrace' => trim(debug_get_mailable_backtrace())
-               );
+               ];
 
                // Send email to webmaster
                sendAdminNotification('{--REPORT_BUG_SUBJECT--}', 'admin_report_bug', $content);
@@ -1382,8 +1382,8 @@ function compileUriCode ($code, $simple = TRUE) {
        } // END - if
 
        // Compile these by default
-       $charsCompile = array(
-               'from' => array(
+       $charsCompile = [
+               'from' => [
                        '{DOT}',
                        '{SLASH}',
                        '{QUOT}',
@@ -1393,8 +1393,8 @@ function compileUriCode ($code, $simple = TRUE) {
                        '{OPEN_SQR}',
                        '{CLOSE_SQR}',
                        '{PER}'
-               ),
-               'to' => array(
+               ],
+               'to' => [
                        '.',
                        '/',
                        chr(39),
@@ -1404,8 +1404,8 @@ function compileUriCode ($code, $simple = TRUE) {
                        '[',
                        ']',
                        '%'
-               )
-       );
+               ]
+       ];
 
        // Compile constants
        if ($simple === FALSE) {
index 3359e772daba63b1e8db67239f3a4c55a398fae2..43fd4de29bd237f7c712f67c34f48803811762d4 100644 (file)
@@ -2884,10 +2884,10 @@ function getTotalPoints ($userid) {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Init array for filter chain
-               $data = array(
+               $data = [
                        'userid' => $userid,
                        'points' => 0
-               );
+               ];
 
                // Run filter chain for getting more point values
                $data = runFilterChain('get_total_points', $data);
@@ -3260,11 +3260,11 @@ function getUserLastWhatName () {
 // "Getter" for all columns for given alias and separator
 function getAllPointColumns ($alias = NULL, $separator = ',') {
        // Prepare the filter array
-       $filterData = array(
+       $filterData = [
                'columns'   => '',
                'alias'     => $alias,
                'separator' => $separator
-       );
+       ];
 
        // Run the filter
        $filterData = runFilterChain('get_all_point_columns', $filterData);