From 50de3a1d66e8c897d141254111aaa18dcc40f5f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 19 Sep 2011 17:56:33 +0000 Subject: [PATCH] Now getCurrentTheme() does check if 'theme' is provided in POST data or URL, by POST rules --- inc/functions.php | 18 +++++++++++++++--- inc/stylesheet.php | 8 +------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index eb353b4481..e768c7e02e 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -534,6 +534,12 @@ function makeTime ($hours, $minutes, $seconds, $stamp) { // Redirects to an URL and if neccessarry extends it with own base URL function redirectToUrl ($url, $allowSpider = true) { + // Is the output mode -2? + if (getScriptOutputMode() == -2) { + // This is always (!) an AJAX request and shall not be redirected + return; + } // END - if + // Remove {%url= if (substr($url, 0, 6) == '{%url=') { $url = substr($url, 6, -2); @@ -1048,11 +1054,17 @@ function getCurrentTheme () { // The default theme is 'default'... ;-) $ret = 'default'; - // Do we have ext-theme installed and active? - if (isExtensionActive('theme')) { + // Do we have ext-theme installed and active or is 'theme' in URL or POST data? + if ((isPostRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", postRequestElement('theme'))))) { + // Use value from POST data + $ret = postRequestElement('theme'); + } elseif ((isGetRequestElementSet('theme')) && (isIncludeReadable(sprintf("theme/%s/theme.php", getRequestElement('theme'))))) { + // Use value from GET data + $ret = getRequestElement('theme'); + } elseif (isExtensionActive('theme')) { // Call inner method $ret = getActualTheme(); - } // END - if + } // Return theme value return $ret; diff --git a/inc/stylesheet.php b/inc/stylesheet.php index 715bf8fc4c..ab881f0286 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -108,13 +108,7 @@ if ((isCssOutputMode()) || (getConfig('css_php') == 'DIRECT')) { $OUT = '