diff --git a/libraries/loader.php b/libraries/loader.php index e593146502231..916a04bae8dd7 100644 --- a/libraries/loader.php +++ b/libraries/loader.php @@ -280,6 +280,8 @@ public static function registerPrefix($prefix, $path, $reset = false, $prepend = // Verify the library path exists. if (!file_exists($path)) { + $path = (str_replace(JPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(JPATH_ROOT, '', $path); + throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); } @@ -344,6 +346,8 @@ public static function registerNamespace($namespace, $path, $reset = false, $pre // Verify the library path exists. if (!file_exists($path)) { + $path = (str_replace(JPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(JPATH_ROOT, '', $path); + throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); }