]> git.mxchange.org Git - mailer.git/blobdiff - inc/language.php
Another column fix
[mailer.git] / inc / language.php
index 89f7bba9ead15a2bc5e3e94dbc07acca0328f1ef..fc7f73c1b71aecc9ec7d8eeb243ced27d2784756 100644 (file)
  ************************************************************************/
 
 // 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");
 }