From e7f6cd2cfa2995de8dc3d3dbc145922de8c67747 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Sat, 23 Dec 2017 10:58:51 -0500 Subject: fix dupe bug in content hooks --- Zotlabs/Web/Router.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php index 12ef315d4..b1bc9655c 100644 --- a/Zotlabs/Web/Router.php +++ b/Zotlabs/Web/Router.php @@ -263,21 +263,21 @@ class Router { } if(! \App::$error) { - $arr = array('content' => \App::$page['content'], 'replace' => false); - call_hooks(\App::$module . '_mod_content', $arr); - \App::$page['content'] = $arr['content']; - if(! $arr['replace']) { - if($this->controller && method_exists($this->controller,'get')) { - $arr = array('content' => $this->controller->get()); - } - elseif(function_exists(\App::$module . '_content')) { - $func = \App::$module . '_content'; - $arr = array('content' => $func($a)); - } - } - call_hooks(\App::$module . '_mod_aftercontent', $arr); - \App::$page['content'] .= $arr['content']; + $arr = array('content' => \App::$page['content'], 'replace' => false); + call_hooks(\App::$module . '_mod_content', $arr); + + if(! $arr['replace']) { + if($this->controller && method_exists($this->controller,'get')) { + $arr = array('content' => $this->controller->get()); + } + elseif(function_exists(\App::$module . '_content')) { + $func = \App::$module . '_content'; + $arr = array('content' => $func($a)); + } + } + call_hooks(\App::$module . '_mod_aftercontent', $arr); + \App::$page['content'] = (($arr['replace']) ? $arr['content'] : \App::$page['content'] . $arr['content']); } } } -} \ No newline at end of file +} -- cgit v1.2.3 From ef952a41b3af7af60c4c3329428c9503c2f39333 Mon Sep 17 00:00:00 2001 From: Matthew Dent Date: Sat, 23 Dec 2017 11:09:37 -0500 Subject: Fix whitespace formatting --- Zotlabs/Web/Router.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php index b1bc9655c..a6b780cdc 100644 --- a/Zotlabs/Web/Router.php +++ b/Zotlabs/Web/Router.php @@ -263,20 +263,20 @@ class Router { } if(! \App::$error) { - $arr = array('content' => \App::$page['content'], 'replace' => false); - call_hooks(\App::$module . '_mod_content', $arr); - - if(! $arr['replace']) { - if($this->controller && method_exists($this->controller,'get')) { - $arr = array('content' => $this->controller->get()); - } - elseif(function_exists(\App::$module . '_content')) { - $func = \App::$module . '_content'; - $arr = array('content' => $func($a)); - } - } - call_hooks(\App::$module . '_mod_aftercontent', $arr); - \App::$page['content'] = (($arr['replace']) ? $arr['content'] : \App::$page['content'] . $arr['content']); + $arr = array('content' => \App::$page['content'], 'replace' => false); + call_hooks(\App::$module . '_mod_content', $arr); + + if(! $arr['replace']) { + if($this->controller && method_exists($this->controller,'get')) { + $arr = array('content' => $this->controller->get()); + } + elseif(function_exists(\App::$module . '_content')) { + $func = \App::$module . '_content'; + $arr = array('content' => $func($a)); + } + } + call_hooks(\App::$module . '_mod_aftercontent', $arr); + \App::$page['content'] = (($arr['replace']) ? $arr['content'] : \App::$page['content'] . $arr['content']); } } } -- cgit v1.2.3