From 90f7713e850d360159754d4223e012db4f2dfaf2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Thu, 25 May 2017 15:03:07 +0200 Subject: [PATCH] check file existance before autoloading Even for our own namespace, file existance should be checked before attempting to load it. Otherwise class_exist() check will throw errors. --- inc/load.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/load.php b/inc/load.php index d2a0e3442..9432e733a 100644 --- a/inc/load.php +++ b/inc/load.php @@ -135,8 +135,11 @@ function load_autoload($name){ // our own namespace if(substr($name, 0, 9) == 'dokuwiki/') { - require substr($name, 9) . '.php'; - return true; + $file = DOKU_INC . 'inc/'. substr($name, 9) . '.php'; + if(file_exists($file)) { + require $file; + return true; + } } // Plugin loading -- GitLab