aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-11-25 17:12:28 +0100
committerMario <mario@mariovavti.com>2023-11-25 17:12:28 +0100
commit0fd8e02a884a2b040dca62ab5d9674db5f6a070b (patch)
tree586ee43f32f6f14368c09026f21dcd3244ea24b6 /include/plugin.php
parent82e704ec5b107823c09f1387e9091adee53a4c2d (diff)
parent55c4bfb67009c598f25b1a8189604bfffa73dfbb (diff)
downloadvolse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.tar.gz
volse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.tar.bz2
volse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.zip
Merge branch '8.8RC'8.8
Diffstat (limited to 'include/plugin.php')
-rw-r--r--include/plugin.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/plugin.php b/include/plugin.php
index ae73a847c..f1d501001 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -459,8 +459,6 @@ function insert_hook($hook, $fn, $version = 0, $priority = 0) {
* @param[in,out] string|array &$data to transmit to the callback handler
*/
function call_hooks($name, &$data = null) {
- $a = 0;
-
if (isset(App::$hooks[$name])) {
foreach(App::$hooks[$name] as $hook) {
@@ -482,9 +480,13 @@ function call_hooks($name, &$data = null) {
}
$data = $checkhook['data'];
}
+
$origfn = $hook[1];
- if($hook[0])
+
+ if($hook[0]) {
@include_once($hook[0]);
+ }
+
if(preg_match('|^a:[0-9]+:{.*}$|s', $hook[1])) {
$hook[1] = unserialize($hook[1]);
}
@@ -496,15 +498,12 @@ function call_hooks($name, &$data = null) {
$hook[1] = explode('::',$hook[1]);
}
+
if(is_callable($hook[1])) {
$func = $hook[1];
- if($hook[3])
- $func($data);
- else
- $func($a, $data);
+ $func($data);
}
else {
-
// Don't do any DB write calls if we're currently logging a possibly failed DB call.
if(! DBA::$logging) {
// The hook should be removed so we don't process it.
@@ -1074,6 +1073,7 @@ function theme_include($file, $root = '') {
$paths = array(
"{$root}view/theme/$thname/$ext/$file",
+ "{$root}view/theme/$thname/widget/$file",
"{$root}view/theme/$parent/$ext/$file",
"{$root}view/site/$ext/$file",
"{$root}view/$ext/$file",