mirror of
https://github.com/friendica/friendica
synced 2024-11-19 22:23:40 +00:00
ParseUrl: Perform entitity decode afterwards
This commit is contained in:
parent
ae0fc112b1
commit
4db6f11884
1 changed files with 8 additions and 3 deletions
|
@ -466,8 +466,7 @@ class ParseUrl
|
|||
$list = $xpath->query("//script[@type='application/ld+json']");
|
||||
foreach ($list as $node) {
|
||||
if (!empty($node->nodeValue)) {
|
||||
$nodevalue = html_entity_decode($node->nodeValue, ENT_COMPAT, 'UTF-8');
|
||||
if ($jsonld = json_decode($nodevalue, true)) {
|
||||
if ($jsonld = json_decode($node->nodeValue, true)) {
|
||||
$siteinfo = self::parseParts($siteinfo, $jsonld);
|
||||
}
|
||||
}
|
||||
|
@ -701,10 +700,16 @@ class ParseUrl
|
|||
if ($numeric_keys) {
|
||||
foreach ($jsonld as $part) {
|
||||
$siteinfo = self::parseParts($siteinfo, $part);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
array_walk_recursive($siteinfo, function (&$element) {
|
||||
if (is_string($element)) {
|
||||
$element = html_entity_decode($element, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
});
|
||||
|
||||
return $siteinfo;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue