From b703ce435ba858c2afca7afd554b632a8ace6471 Mon Sep 17 00:00:00 2001 From: thisgun Date: Fri, 5 Feb 2021 12:19:24 +0900 Subject: [PATCH] =?UTF-8?q?HOOK=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EC=BD=94=EB=93=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Hook/hook.extends.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Hook/hook.extends.class.php b/lib/Hook/hook.extends.class.php index 4ebdb4a89..bf5bc03e2 100644 --- a/lib/Hook/hook.extends.class.php +++ b/lib/Hook/hook.extends.class.php @@ -130,10 +130,11 @@ Class GML_Hook extends Hook { if (isset($that->callback_filters[$tag]) && isset($that->callback_filters[$tag][$priority]) ) { - $found_key = array_search($func, array_column($that->callback_filters[$tag][$priority], 'function')); - - if( $found_key !== false ){ - unset($that->callback_filters[$tag][$priority][$found_key]); + foreach((array) $that->callback_filters[$tag][$priority] as $key=>$value){ + if(isset($value['function']) && $value['function'] === $func) { + unset($that->callback_filters[$tag][$priority][$key]); + $is_remove = true; + } } } @@ -148,10 +149,11 @@ Class GML_Hook extends Hook { if (isset($that->callbacks[$tag]) && isset($that->callbacks[$tag][$priority]) ) { - $found_key = array_search($func, array_column($that->callbacks[$tag][$priority], 'function')); - - if( $found_key !== false ){ - unset($that->callbacks[$tag][$priority][$found_key]); + foreach((array) $that->callbacks[$tag][$priority] as $key=>$value){ + if(isset($value['function']) && $value['function'] === $func) { + unset($that->callbacks[$tag][$priority][$key]); + $is_remove = true; + } } }