X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flanguage.php;h=fc7f73c1b71aecc9ec7d8eeb243ced27d2784756;hp=4790793a23805ddc7ac1e1865125420e089b71c1;hb=a0c37ca650d27d0aed672ebf34e1be4601a2e0e9;hpb=dbd1bc95c8f89024118791dc3fb3633a90afa9cf diff --git a/inc/language.php b/inc/language.php index 4790793a23..fc7f73c1b7 100644 --- a/inc/language.php +++ b/inc/language.php @@ -32,31 +32,29 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } +// Set default language if (empty($mx_lang)) $mx_lang = DEFAULT_LANG; // Look for file -$file = sprintf(PATH."inc/language/%s.php", $mx_lang); -if (!file_exists($file)) -{ +$file = sprintf("%sinc/language/%s.php", PATH, $mx_lang); +if (!FILE_READABLE($file)) { // Switch to default (DO NOT CHANGE!!!) - @setcookie("mx_lang", "de", (time() + $CONFIG['online_timeout']), COOKIE_PATH); + set_session("mx_lang", "de"); $mx_lang = "de"; - $file = sprintf(PATH."inc/language/%s.php", $mx_lang); -} + $file = sprintf("%sinc/language/%s.php", PATH, "de"); +} // END - if // Load language file require($file); unset($file); // Check for installation mode -if (!mxchange_installed) -{ +if (isBooleanConstantAndTrue('mxchange_installing')) { // Load matching language file require(PATH."inc/language/install_".$mx_lang.".php"); }