Fixes for various bugs (e.g.: 'secret file could not be read', SQL error and more)
[mailer.git] / inc / wrapper-functions.php
index 20169be5dd324ab3e6199474f65343fd935370df..9eee082a5fb26ac7d776654bca2d5d5ffd5d958c 100644 (file)
@@ -829,7 +829,7 @@ function isBlockModeEnabled () {
        // Abort if not set
        if (!isset($GLOBALS['__block_mode'])) {
                // Needs to be fixed
-               reportBug(__FUNCTION__, __LINE__, 'Block_mode is not set.');
+               reportBug(__FUNCTION__, __LINE__, '__block_mode is not set.');
        } // END - if
 
        // Return it
@@ -1175,7 +1175,7 @@ function isDebugTemplateCacheEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_TEMPLATE_CACHE')) && (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1594,7 +1594,7 @@ function isTitleDecorationEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Just check it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_title_deco') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_title_deco')) && (getConfig('enable_title_deco') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1654,7 +1654,7 @@ function isDisplayDebugSqlEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getDisplayDebugSqls() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (isConfigEntrySet('display_debug_sql')) && (getDisplayDebugSqls() == 'Y'));
        } // END - if
 
        // Return cache
@@ -1666,7 +1666,7 @@ function isModuleTitleEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_mod_title') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_mod_title')) && (getConfig('enable_mod_title') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1678,7 +1678,7 @@ function isWhatTitleEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_what_title') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_what_title')) && (getConfig('enable_what_title') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1714,7 +1714,7 @@ function isAdminNotificationEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getAdminNotify() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (isConfigEntrySet('admin_notify')) && (getAdminNotify() == 'Y'));
        } // END - if
 
        // Return cache
@@ -1726,7 +1726,7 @@ function isRandomReferralIdEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getSelectUserZeroRefid() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (isConfigEntrySet('select_user_zero_refid')) && (getSelectUserZeroRefid() == 'Y'));
        } // END - if
 
        // Return cache
@@ -2601,7 +2601,7 @@ function isDisplayHomeInIndexEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getDisplayHomeInIndex() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.3')) && (isConfigEntrySet('display_home_in_index')) && (getDisplayHomeInIndex() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2625,7 +2625,7 @@ function isShowPointsUnconfirmedEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getShowPointsUnconfirmed() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.5.5')) && (isConfigEntrySet('show_points_unconfirmed')) && (getShowPointsUnconfirmed() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2649,7 +2649,7 @@ function isYoureHereEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getYoureHere() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (isConfigEntrySet('youre_here')) && (getYoureHere() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2673,7 +2673,7 @@ function isShowTimingsEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getShowTimings() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (isConfigEntrySet('show_timings')) && (getShowTimings() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2910,7 +2910,7 @@ function isDirectPaymentEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('allow_direct_pay') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('allow_direct_pay')) && (getConfig('allow_direct_pay') == 'Y'));
        } // END - if
 
        // Return cache
@@ -2922,7 +2922,7 @@ function isAdminMenuJavascriptEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (getAdminMenuJavaScript() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (isConfigEntrySet('admin_menu_javascript')) && (getAdminMenuJavaScript() == 'Y'));
        } // END - if
 
        // Return cache