Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed directory traversal issues.
  • Loading branch information
itronics committed May 21, 2014
1 parent 3c10290 commit a5dcd87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/inst_module.php
Expand Up @@ -42,8 +42,8 @@ function local_extension($id)
'active' => false
);

if (file_exists($path_to_root.'/modules/'.$id.'/hooks.php')) {
include_once($path_to_root.'/modules/'.$id.'/hooks.php');
if (file_exists($path_to_root.'/modules/'.clean_file_name($id).'/hooks.php')) {
include_once($path_to_root.'/modules/'.clean_file_name($id).'/hooks.php');
}
$hooks_class = 'hooks_'.$id;
if (class_exists($hooks_class, false)) {
Expand Down
5 changes: 3 additions & 2 deletions includes/hooks.inc
Expand Up @@ -225,9 +225,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;
Expand Down

0 comments on commit a5dcd87

Please sign in to comment.