mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
prevent function name re-declaration in widget space
This commit is contained in:
parent
8dd4270a6a
commit
ed5405d4f7
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue