https://reisub.nsupdate.info/git
/
friendica.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ae0fc11
)
ParseUrl: Perform entitity decode afterwards
author
Michael
<heluecht@pirati.ca>
Mon, 22 Mar 2021 06:47:04 +0000
(06:47 +0000)
committer
Michael
<heluecht@pirati.ca>
Mon, 22 Mar 2021 06:47:04 +0000
(06:47 +0000)
src/Util/ParseUrl.php
patch
|
blob
|
history
diff --git
a/src/Util/ParseUrl.php
b/src/Util/ParseUrl.php
index
af34a0c
..
d2986a3
100644
(file)
--- a/
src/Util/ParseUrl.php
+++ b/
src/Util/ParseUrl.php
@@
-466,8
+466,7
@@
class ParseUrl
$list = $xpath->query("//script[@type='application/ld+json']");
foreach ($list as $node) {
if (!empty($node->nodeValue)) {
$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);
}
}
$siteinfo = self::parseParts($siteinfo, $jsonld);
}
}
@@
-701,10
+700,16
@@
class ParseUrl
if ($numeric_keys) {
foreach ($jsonld as $part) {
$siteinfo = self::parseParts($siteinfo, $part);
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;
}
return $siteinfo;
}