Add support for local files for unsecured document loading #1
1 changed files with 2 additions and 2 deletions
|
@ -346,7 +346,7 @@ function jsonld_get_url($url)
|
||||||
/**
|
/**
|
||||||
* The default implementation to retrieve JSON-LD at the given URL.
|
* The default implementation to retrieve JSON-LD at the given URL.
|
||||||
*
|
*
|
||||||
* @param string $url the URL to to retrieve.
|
* @param string $url The document URL or a local path
|
||||||
*
|
*
|
||||||
* @return stdClass the RemoteDocument object.
|
* @return stdClass the RemoteDocument object.
|
||||||
*/
|
*/
|
||||||
|
@ -388,7 +388,7 @@ function jsonld_default_document_loader($url)
|
||||||
}
|
}
|
||||||
|
|
||||||
$link_header = [];
|
$link_header = [];
|
||||||
foreach ($http_response_header as $header) {
|
foreach ($http_response_header ?? [] as $header) {
|
||||||
if (strpos($header, 'link') === 0) {
|
if (strpos($header, 'link') === 0) {
|
||||||
$value = explode(': ', $header);
|
$value = explode(': ', $header);
|
||||||
if (count($value) > 1) {
|
if (count($value) > 1) {
|
||||||
|
|
Loading…
Reference in a new issue