X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fhooks.inc;h=cb5cddfa9db3e604635b80a3ab52023cb0dd3cbb;hb=fd11a3b500e79a3e98f7a3860f872cd31ce33113;hp=ab2d2bdc6af5b1cb00f193e5fb1158c603f6c6b8;hpb=cb7da60bef5f27507540f827e4a03ede8d08f684;p=fa-stable.git diff --git a/includes/hooks.inc b/includes/hooks.inc index ab2d2bdc..cb5cddfa 100644 --- a/includes/hooks.inc +++ b/includes/hooks.inc @@ -116,6 +116,7 @@ class hooks { function price_in_words($amount, $doc_type) { } + // // Exchange rate currency $curr as on date $date. // Keep in mind FA has internally implemented 3 exrate providers @@ -225,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; @@ -248,7 +250,7 @@ function install_hooks() function activate_hooks($ext, $comp) { global $Hooks; - + $hooks = @$Hooks[$ext]; if (!$hooks) { $hookclass = 'hooks_'.$ext; @@ -311,7 +313,7 @@ function hook_invoke_first($method, &$data, $opts=null) { global $Hooks; - + $result = null; foreach($Hooks as $ext => $hook) { if (method_exists($hook, $method)) {