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; Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r4590 -r4594 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4590) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4594) @@ -146,7 +146,10 @@ function findConfigFiles($folderPath) { - $folderPath = str_replace(FULL_PATH, '', $folderPath); // this make sense, since $folderPath may NOT contain FULL_PATH + // if FULL_PATH = "/" ensure, that all "/" in $folderPath are not deleted + $reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/'; + $folderPath = preg_replace($reg_exp, '', $folderPath, 1); // this make sense, since $folderPath may NOT contain FULL_PATH + $fh=opendir(FULL_PATH.$folderPath); while(($sub_folder=readdir($fh))) { Index: trunk/kernel/include/itemtypes.php =================================================================== diff -u -r3043 -r4594 --- trunk/kernel/include/itemtypes.php (.../itemtypes.php) (revision 3043) +++ trunk/kernel/include/itemtypes.php (.../itemtypes.php) (revision 4594) @@ -70,9 +70,11 @@ function LoadAllItems() { - $t = $this->SourceTable; - $m = GetTablePrefix()."Modules"; - $sql = "SELECT * FROM $t INNER JOIN $m ON ($t.Module=$m.Name) WHERE Loaded=1 ORDER BY LoadOrder"; + $sql = 'SELECT * + FROM '.$this->SourceTable.' it + INNER JOIN '.TABLE_PREFIX.'Modules m ON it.Module = m.Name + WHERE (m.Loaded = 1) AND (LENGTH(it.ClassName) > 0) + ORDER BY m.LoadOrder'; $this->Query_Item($sql); }