Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Test if a constant exists. #597

Closed
wants to merge 1 commit into from

4 participants

@elinw

Modify the test that checks whether JPATH_ROOT exists.

@mbabker
Owner

@nikosdion already has a fix for this (introduced in #584) in #594.

@elinw

hm I'm not sure which I think is better.

@joomla-jenkins
Collaborator

The tests completed but there was a problem parsing the report.
Checkstyle analysis reported 254 warnings and 1 errors.

@ianmacl ianmacl closed this
@ianmacl

This has already been fixed in the aforementioned pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2011
  1. @elinw

    Test if a constant exists.

    elinw authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  libraries/joomla/filesystem/path.php
View
2  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);
Something went wrong with that request. Please try again.