Index: trunk/core/kernel/application.php =================================================================== diff -u -r4592 -r4594 --- trunk/core/kernel/application.php (.../application.php) (revision 4592) +++ trunk/core/kernel/application.php (.../application.php) (revision 4594) @@ -544,7 +544,7 @@ if ($this->isModuleEnabled('In-CMS')) { $cms_handler =& $this->recallObject('cms_EventHandler'); - if (!$template_cache->TemplateExists($t)) { + if (!$template_cache->TemplateExists($t) && !$this->IsAdmin()) { $t = $cms_handler->GetDesignTemplate(); } /*else { @@ -1504,12 +1504,23 @@ /** * Apply url rewriting used by mod_rewrite or not * + * @param bool $ssl Force ssl link to be build * @return bool */ function RewriteURLs($ssl = false) { + // case #1,#4: + // we want to create https link from http mode + // we want to create https link from https mode + // conditions: ($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL') + + // case #2,#3: + // we want to create http link from https mode + // we want to create http link from http mode + // conditions: !$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://') + $allow_rewriting = - (PROTOCOL == 'http://') // always allow mod_rewrite for http + (!$ssl && (PROTOCOL == 'https://' || PROTOCOL == 'http://')) // always allow mod_rewrite for http || // or allow rewriting for redirect TO httpS or when already in httpS (($ssl || PROTOCOL == 'https://') && $this->ConfigValue('UseModRewriteWithSSL')); // but only if it's allowed in config! return constOn('MOD_REWRITE') && $allow_rewriting;