Skip to content
Snippets Groups Projects
Commit 92faea0e authored by Michael Hamann's avatar Michael Hamann
Browse files

Load plugins using include_once instead of include

The problem with using include is that when the file that is loaded
does not contain the plugin class (e.g. because the directory name is
wrong), the file could be loaded again when the plugin class is
requested a second time which will lead to a fatal error because of
class redeclaration.
parent baf1d9a0
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ function load_autoload($name){
$c = ((count($m) === 4) ? "/{$m[3]}" : '');
$plg = DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
if(@file_exists($plg)){
include DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
include_once DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
}
return;
}
......
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