forked from friendica/php-json-ld
Do not remove relative '../' with empty base.
This commit is contained in:
parent
24fa461705
commit
baa3cdf2f6
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue