diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-02 18:25:09 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-02 18:25:09 -0800 |
commit | ed5405d4f73983c3468d545ec2a9b9e5f1ae4d28 (patch) | |
tree | a1eddd70a7b2dc8dbaf89b6d4375c18dd5971fc4 /include | |
parent | 8dd4270a6aae1203bf99585a126b881a78002304 (diff) | |
download | volse-hubzilla-ed5405d4f73983c3468d545ec2a9b9e5f1ae4d28.tar.gz volse-hubzilla-ed5405d4f73983c3468d545ec2a9b9e5f1ae4d28.tar.bz2 volse-hubzilla-ed5405d4f73983c3468d545ec2a9b9e5f1ae4d28.zip |
prevent function name re-declaration in widget space
Diffstat (limited to 'include')
-rw-r--r-- | include/comanche.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/comanche.php b/include/comanche.php index 9585a6578..ef71886f2 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -282,15 +282,16 @@ function comanche_widget($name, $text) { } } - if(file_exists('widget/' . trim($name) . '.php')) + $func = 'widget_' . trim($name); + + if((! function_exists($func)) && file_exists('widget/' . trim($name) . '.php')) require_once('widget/' . trim($name) . '.php'); else { - $theme_widget = 'widget_' . trim($name) . '.php'; - if(theme_include($theme_widget)) + $theme_widget = $func . '.php'; + if((! function_exists($func)) && theme_include($theme_widget)) require_once(theme_include($theme_widget)); } - $func = 'widget_' . trim($name); if (function_exists($func)) return $func($vars); } |