Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix hook PHP Notice
This commit resolves the problem of PHP Notice that always appeared in error log
  • Loading branch information
atmoner committed Jul 26, 2018
1 parent a9c6019 commit bd5f6a4
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions libs/Hooks.class.php
Expand Up @@ -222,20 +222,25 @@ function hook_exist($tag) {
* @return optional.
*/
function execute_hook($tag, $args = '') {
if (isset ( $this->hooks [$tag] )) {
$these_hooks = $this->hooks [$tag];
for($i = 0; $i <= 20; $i ++) {
if (isset ( $these_hooks [$i] )) {
foreach ( $these_hooks [$i] as $hook ) {
// $args [] = $result;
$result = call_user_func ( $hook, $args );
}
}
}
return $result;
} else {
die ( "There is no such place ($tag) for hooks." );
}
if (isset ( $this->hooks [$tag] )) {
$these_hooks = $this->hooks [$tag];
for($i = 0; $i <= 20; $i ++) {
if (isset ( $these_hooks [$i] )) {
foreach ( $these_hooks [$i] as $hook ) {
// $args [] = $result;
$result = call_user_func ( $hook, $args );
}
}
}
//var_dump($these_hooks);
if (isset($result))
return $result;
else
return null;

} else {
die ( "There is no such place ($tag) for hooks." );
}
}

/**
Expand Down

0 comments on commit bd5f6a4

Please sign in to comment.