Do not remove relative '../' with empty base.

This commit is contained in:
Dave Longley 2013-02-28 16:50:43 -05:00
parent 24fa461705
commit baa3cdf2f6
1 changed files with 32 additions and 29 deletions

View File

@ -403,6 +403,8 @@ function jsonld_prepend_base($base, $iri) {
};
$segments = array_values(array_filter($segments, $filter));
// do not remove '..' for empty base
if($base['scheme'] !== '') {
// remove as many '..' as possible
for($i = 0; $i < count($segments);) {
$segment = $segments[$i];
@ -428,6 +430,7 @@ function jsonld_prepend_base($base, $iri) {
$i += 1;
}
}
}
$path = implode('/', $segments);