diff options
author | Michael Hamann <michael@content-space.de> | 2012-09-09 13:04:24 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2012-09-09 13:04:24 +0200 |
commit | 92faea0e5fc27ca47d6fa6c18b1da1d6b6cac4a0 (patch) | |
tree | 1133c37c709da51b17fc12d8cb10e040f914ee0e | |
parent | baf1d9a01127509f8f14cf4b6754a9eea0f1277a (diff) | |
download | rpg-92faea0e5fc27ca47d6fa6c18b1da1d6b6cac4a0.tar.gz rpg-92faea0e5fc27ca47d6fa6c18b1da1d6b6cac4a0.tar.bz2 |
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.
-rw-r--r-- | inc/load.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/load.php b/inc/load.php index 8df68d1b3..ddd12b546 100644 --- a/inc/load.php +++ b/inc/load.php @@ -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; } |