From: Marcel Werk Date: Tue, 20 Sep 2011 13:20:19 +0000 (+0200) Subject: Setup fixed X-Git-Tag: 2.0.0_Beta_1~1784 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=491d7b098e3fd6a7d49aaeb2fad3d8ef01c35cf8;p=GitHub%2FWoltLab%2FWCF.git Setup fixed --- diff --git a/wcfsetup/install/files/acp/templates/cronjobList.tpl b/wcfsetup/install/files/acp/templates/cronjobList.tpl index 77bc7985bd..a01e53012c 100644 --- a/wcfsetup/install/files/acp/templates/cronjobList.tpl +++ b/wcfsetup/install/files/acp/templates/cronjobList.tpl @@ -83,24 +83,24 @@ {/if} {if $cronjob->canBeDisabled()} - + {else} {if $cronjob->active} - + {else} - + {/if} {/if} {if $cronjob->isEditable()} - + {else} - + {/if} {if $cronjob->isDeletable()} - + {else} - + {/if} {if $additionalButtons[$cronjob->cronjobID]|isset}{@$additionalButtons[$cronjob->cronjobID]}{/if} diff --git a/wcfsetup/install/files/lib/data/language/Language.class.php b/wcfsetup/install/files/lib/data/language/Language.class.php index 76fe59a8d2..9873f7b2d8 100644 --- a/wcfsetup/install/files/lib/data/language/Language.class.php +++ b/wcfsetup/install/files/lib/data/language/Language.class.php @@ -59,7 +59,7 @@ class Language extends DatabaseObject { * @return string */ public function getFixedLanguageCode() { - return LanguageFactory::getInstance()->fixLanguageCode($this->languageCode); + return LanguageFactory::fixLanguageCode($this->languageCode); } /** diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 0880c81eef..91ef937ea4 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -91,7 +91,7 @@ class WCFSetup extends WCF { self::$selectedLanguageCode = $_REQUEST['languageCode']; } else { - self::$selectedLanguageCode = LanguageFactory::getInstance()->getPreferredLanguage(self::$availableLanguages, self::$selectedLanguageCode); + self::$selectedLanguageCode = LanguageFactory::getPreferredLanguage(self::$availableLanguages, self::$selectedLanguageCode); } if (isset($_POST['selectedLanguages']) && is_array($_POST['selectedLanguages'])) { diff --git a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php index 8be53f8c08..37a1d9fb21 100644 --- a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php +++ b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php @@ -112,7 +112,7 @@ class LanguageFactory extends SingletonFactory { $defaultLanguageCode = $this->cache['languages'][$this->cache['default']]['languageCode']; // get preferred language - $languageCode = $this->getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode); + $languageCode = self::getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode); // get language id of preferred language foreach ($this->cache['languages'] as $key => $language) { @@ -129,12 +129,12 @@ class LanguageFactory extends SingletonFactory { * @param string $defaultLanguageCode * @return string */ - public function getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode) { + public static function getPreferredLanguage($availableLanguageCodes, $defaultLanguageCode) { if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $_SERVER['HTTP_ACCEPT_LANGUAGE']) { $acceptedLanguages = explode(',', str_replace('_', '-', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']))); foreach ($acceptedLanguages as $acceptedLanguage) { foreach ($availableLanguageCodes as $availableLanguageCode) { - $fixedCode = strtolower($this->fixLanguageCode($availableLanguageCode)); + $fixedCode = strtolower(self::fixLanguageCode($availableLanguageCode)); if ($fixedCode == $acceptedLanguage || $fixedCode == preg_replace('%^([a-z]{2}).*$%i', '$1', $acceptedLanguage)) { return $availableLanguageCode; @@ -205,13 +205,15 @@ class LanguageFactory extends SingletonFactory { * Loads the language cache. */ protected function loadCache() { - CacheHandler::getInstance()->addResource( - 'languages', - WCF_DIR.'cache/cache.languages.php', - 'wcf\system\cache\builder\LanguageCacheBuilder' - ); - - $this->cache = CacheHandler::getInstance()->get('languages'); + if (defined('WCF_N')) { + CacheHandler::getInstance()->addResource( + 'languages', + WCF_DIR.'cache/cache.languages.php', + 'wcf\system\cache\builder\LanguageCacheBuilder' + ); + + $this->cache = CacheHandler::getInstance()->get('languages'); + } } /** @@ -241,7 +243,7 @@ class LanguageFactory extends SingletonFactory { * @param string $languageCode * @return string $languageCode */ - public function fixLanguageCode($languageCode) { + public static function fixLanguageCode($languageCode) { return preg_replace('/-[a-z0-9]+/', '', $languageCode); } diff --git a/wcfsetup/install/files/options.inc.php b/wcfsetup/install/files/options.inc.php index ef8957fd5b..c1aecf7297 100644 --- a/wcfsetup/install/files/options.inc.php +++ b/wcfsetup/install/files/options.inc.php @@ -19,6 +19,8 @@ define('BLACKLIST_USER_AGENTS', ''); define('BLACKLIST_HOSTNAMES', ''); define('SESSION_TIMEOUT', 3600); +define('SESSION_VALIDATE_IP_ADDRESS', 0); +define('SESSION_VALIDATE_USER_AGENT', 0); define('CACHE_SOURCE_TYPE', 'disk'); define('ENABLE_SESSION_DATA_CACHE', 0);