From: Roland Häder Date: Sat, 30 Oct 2010 20:15:37 +0000 (+0000) Subject: Fix for 'Invalid argument supplied for foreach(),errfile=filters.php,errline=256... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eb042d1491b009a13e394d9dc2a69dc9c487e9ed;p=mailer.git Fix for 'Invalid argument supplied for foreach(),errfile=filters.php,errline=256', see bug #200 --- diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 91a16286fe..e1be2665f0 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1474,18 +1474,16 @@ function generateOptionList ($table, $id, $name, $default = '', $special = '', $ // Activate exchange function FILTER_ACTIVATE_EXCHANGE () { // Is the extension 'user' there? - if ((!isExtensionActive('user')) || (getConfig('activate_xchange') == '0')) { + if ((!isExtensionActive('user')) || (getActivateXchange() == '0')) { // Silently abort here return false; } // END - if // Check total amount of users - if (getTotalConfirmedUser() >= getConfig('activate_xchange')) { + if (getTotalConfirmedUser() >= getActivateXchange()) { // Activate System - setSqlsArray(array( - "UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1", - "UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2", - )); + addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1"); + addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2"); // Run SQLs runFilterChain('run_sqls'); diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index dc9f9eff7c..6aed1f77e9 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1855,6 +1855,18 @@ function getOneDay () { return $GLOBALS[__FUNCTION__]; } +// "Getter" for activate_xchange +function getActivateXchange () { + // Do we have cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('activate_xchange'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Checks wether proxy configuration is used function isProxyUsed () { // Do we have cache?