Stable branch merged up to 2.3.21
[fa-stable.git] / includes / hooks.inc
index 1621d8f48cbc6a9c371101d74b7ff9be9636ede4..cb5cddfa9db3e604635b80a3ab52023cb0dd3cbb 100644 (file)
@@ -226,9 +226,10 @@ function install_hooks()
        $Hooks = array();
        
        // include current language related $Hooks object if locale file exists
-       if (file_exists($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc"))
+       $lang_code  = clean_file_name($_SESSION['language']->code);
+       if (file_exists($path_to_root . "/lang/" . $lang_code . "/locale.inc"))
        {
-               include_once($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc");
+               include_once($path_to_root . "/lang/" . $lang_code . "/locale.inc");
                $code = $_SESSION['language']->code;
                $hook_class = 'hooks_'.$code;
                $Hooks[$code] = new $hook_class;