forked from friendica/php-json-ld
Check for existing RDF parser before removal.
This commit is contained in:
parent
a4d73b0bb7
commit
aef8eb3e72
|
@ -182,7 +182,7 @@ function jsonld_resolve_url($url) {
|
|||
return $result;
|
||||
}
|
||||
|
||||
/** Registered RDF Statement parsers hashed by content-type. */
|
||||
/** Registered global RDF Statement parsers hashed by content-type. */
|
||||
$jsonld_rdf_parsers = new stdClass();
|
||||
|
||||
/**
|
||||
|
@ -205,8 +205,10 @@ function jsonld_register_rdf_parser($content_type, $parser) {
|
|||
* @param string $content_type the content-type for the parser.
|
||||
*/
|
||||
function jsonld_unregister_rdf_parser($content_type) {
|
||||
global $jsonld_rdf_parsers;
|
||||
unset($jsonld_rdf_parsers->{$content_type});
|
||||
global $jsonld_rdf_parsers;
|
||||
if(property_exists($jsonld_rdf_parsers, $content_type)) {
|
||||
unset($jsonld_rdf_parsers->{$content_type});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue