Leistungsschutzrecht: Optionally suppress pictures

This commit is contained in:
Michael 2018-12-17 21:09:09 +00:00
parent ebd15dc84c
commit 1fa3397362

View file

@ -24,22 +24,24 @@ function leistungsschutzrecht_uninstall() {
}
function leistungsschutzrecht_getsiteinfo($a, &$siteinfo) {
if (!isset($siteinfo["url"])) {
if (!isset($siteinfo["url"]) || empty($siteinfo['type'])) {
return;
}
// Avoid any third party pictures, to avoid copyright issues
if (($siteinfo['type'] != 'photo') && Config::get('leistungsschutzrecht', 'suppress_photos', false)) {
unset($siteinfo["image"]);
unset($siteinfo["images"]);
}
if (!leistungsschutzrecht_is_member_site($siteinfo["url"])) {
return;
}
//$siteinfo["title"] = $siteinfo["url"];
if (!empty($siteinfo["text"])) {
$siteinfo["text"] = leistungsschutzrecht_cuttext($siteinfo["text"]);
}
unset($siteinfo["image"]);
unset($siteinfo["images"]);
unset($siteinfo["keywords"]);
}