Permalink
Browse files

Test if a constant exists.

  • Loading branch information...
elinw committed Dec 3, 2011
1 parent 099cbb5 commit 5e01fd6205391d83c0f5267f9004a1fe1d3a4b4c
Showing with 1 addition and 1 deletion.
  1. +1 −1 libraries/joomla/filesystem/path.php
@@ -177,7 +177,7 @@ public static function check($path, $ds = DIRECTORY_SEPARATOR)
}
$path = JPath::clean($path);
- if (!empty(JPATH_ROOT) && strpos($path, JPath::clean(JPATH_ROOT)) !== 0)
+ if (!defined('JPATH_ROOT') && @constant('JPATH_ROOT') != null && strpos($path, JPath::clean(JPATH_ROOT)) !== 0)
{
// Don't translate
JError::raiseError(20, 'JPath::check Snooping out of bounds @ ' . $path);

0 comments on commit 5e01fd6

Please sign in to comment.