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:
558189e
)
Add logos for person and organisation
author
Michael
<heluecht@pirati.ca>
Wed, 17 Mar 2021 23:31:16 +0000
(23:31 +0000)
committer
Michael
<heluecht@pirati.ca>
Wed, 17 Mar 2021 23:31:16 +0000
(23:31 +0000)
src/Util/ParseUrl.php
patch
|
blob
|
history
diff --git
a/src/Util/ParseUrl.php
b/src/Util/ParseUrl.php
index
389c94a
..
6dc4c2b
100644
(file)
--- a/
src/Util/ParseUrl.php
+++ b/
src/Util/ParseUrl.php
@@
-746,14
+746,33
@@
class ParseUrl
$brand = JsonLD::fetchElement($jsonld, 'publisher', 'brand', '@type', 'Organization');
if (!empty($brand) && is_array($brand)) {
$brand = JsonLD::fetchElement($jsonld, 'publisher', 'brand', '@type', 'Organization');
if (!empty($brand) && is_array($brand)) {
- $content = JsonLD::fetchElement($brand, 'name'
, '@type', 'brand'
);
+ $content = JsonLD::fetchElement($brand, 'name');
if (!empty($content) && is_string($content)) {
$jsonldinfo['publisher_name'] = trim($content);
}
if (!empty($content) && is_string($content)) {
$jsonldinfo['publisher_name'] = trim($content);
}
- $content = JsonLD::fetchElement($brand, 'url', '@type', 'brand');
+
+ $content = JsonLD::fetchElement($brand, 'sameAs');
+ if (!empty($content) && is_string($content)) {
+ $jsonldinfo['publisher_url'] = trim($content);
+ }
+
+ $content = JsonLD::fetchElement($brand, 'url');
if (!empty($content) && is_string($content)) {
$jsonldinfo['publisher_url'] = trim($content);
}
if (!empty($content) && is_string($content)) {
$jsonldinfo['publisher_url'] = trim($content);
}
+
+ $content = JsonLD::fetchElement($brand, 'logo', 'url');
+ if (!empty($content) && is_string($content)) {
+ $jsonldinfo['publisher_img'] = trim($content);
+ }
+ }
+
+ $logo = JsonLD::fetchElement($jsonld, 'publisher', 'logo');
+ if (!empty($logo) && is_array($logo)) {
+ $content = JsonLD::fetchElement($logo, 'url');
+ if (!empty($content) && is_string($content)) {
+ $jsonldinfo['publisher_img'] = trim($content);
+ }
}
} elseif (!empty($jsonld['publisher']) && is_string($jsonld['publisher'])) {
$jsonldinfo['publisher_name'] = trim($jsonld['publisher']);
}
} elseif (!empty($jsonld['publisher']) && is_string($jsonld['publisher'])) {
$jsonldinfo['publisher_name'] = trim($jsonld['publisher']);
@@
-774,6
+793,14
@@
class ParseUrl
if (!empty($content) && is_string($content)) {
$jsonldinfo['author_url'] = trim($content);
}
if (!empty($content) && is_string($content)) {
$jsonldinfo['author_url'] = trim($content);
}
+
+ $logo = JsonLD::fetchElement($jsonld, 'author', 'logo');
+ if (!empty($logo) && is_array($logo)) {
+ $content = JsonLD::fetchElement($logo, 'url');
+ if (!empty($content) && is_string($content)) {
+ $jsonldinfo['author_img'] = trim($content);
+ }
+ }
} elseif (!empty($jsonld['author']) && is_string($jsonld['author'])) {
$jsonldinfo['author_name'] = trim($jsonld['author']);
}
} elseif (!empty($jsonld['author']) && is_string($jsonld['author'])) {
$jsonldinfo['author_name'] = trim($jsonld['author']);
}