Use remote doc documentUrl as base.

This commit is contained in:
Dave Longley 2013-09-14 14:19:27 -04:00
parent 5eeb29a9d2
commit d27ad5f210

View file

@ -833,7 +833,6 @@ class JsonLdProcessor {
*/
public function expand($input, $options) {
self::setdefaults($options, array(
'base' => is_string($input) ? $input : '',
'keepFreeFloatingNodes' => false,
'documentLoader' => 'jsonld_default_document_loader'));
@ -865,6 +864,9 @@ class JsonLdProcessor {
array('remoteDoc' => $remote_doc), $e);
}
// set default base
self::setdefault($options, 'base', $remote_doc->documentUrl ?: '');
// build meta-object and retrieve all @context urls
$input = (object)array(
'document' => self::copy($remote_doc->document),