Skip to content
Snippets Groups Projects
Commit c90b2fb1 authored by chris's avatar chris
Browse files

minor plugin fixes to protect against invalid/malformed plugins

darcs-hash:20050804235036-50fdc-1881a40da689bc5abbe608a2ce96a1ed192a43a4.gz
parent 4f32716e
No related branches found
No related tags found
No related merge requests found
......@@ -199,7 +199,7 @@ function p_get_parsermodes(){
global $PARSER_MODES;
$obj = null;
foreach($pluginlist as $p){
$obj =& plugin_load('syntax',$p); //load plugin into $obj
if(!$obj =& plugin_load('syntax',$p)) continue; //attempt to load plugin into $obj
$PARSER_MODES[$obj->getType()][] = "plugin_$p"; //register mode type
//add to modes
$modes[] = array(
......
......@@ -81,21 +81,17 @@ function &plugin_load($type,$name){
}
//try to load the wanted plugin file
if(!include_once(DOKU_PLUGIN."$name/$type.php")){
if(!@include_once(DOKU_PLUGIN."$name/$type.php")){
list($plugin, $component) = preg_split("/_/",$name, 2);
if (!$component || !include_once(DOKU_PLUGIN."$plugin/$type/$component.php")) {
if (!$component || !@include_once(DOKU_PLUGIN."$plugin/$type/$component.php")) {
return null;
}
}
/* FIXME: chris: what's this for?
global $plugin_investigate_pluginorder;
if (!isset($plugin_investigate_pluginorder)) $plugin_investigate_pluginorder = array();
$plugin_investigate_pluginorder[] = $name;
*/
//construct class and instanciate
$class = $type.'_plugin_'.$name;
if (!class_exists($class)) return null;
$DOKU_PLUGINS[$type][$name] = new $class;
return $DOKU_PLUGINS[$type][$name];
}
......@@ -107,7 +107,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
$plugins = plugin_list('syntax');
foreach($plugins as $p){
$po =& plugin_load('syntax',$p);
if (!$po =& plugin_load('syntax',$p)) continue;
$info = $po->getInfo();
$renderer->doc .= '<li>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment