diff --git a/Code/Module/Linkinfo.php b/Code/Module/Linkinfo.php index 5a40dc016..b87b149c8 100644 --- a/Code/Module/Linkinfo.php +++ b/Code/Module/Linkinfo.php @@ -548,6 +548,9 @@ class Linkinfo extends Controller case "og:image": $siteinfo["image"] = $attr["content"]; break; + case "og:image:alt": + $siteinfo["image_alt"] = $attr["content"]; + break; case "og:title": $siteinfo["title"] = $attr["content"]; break; @@ -568,6 +571,7 @@ class Linkinfo extends Controller } $src = self::completeurl($attr["src"], $url); + $alt = $attr["alt"]; $photodata = @getimagesize($src); if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) { @@ -581,7 +585,9 @@ class Linkinfo extends Controller } $siteinfo["images"][] = ["src" => $src, "width" => $photodata[0], - "height" => $photodata[1]]; + "height" => $photodata[1], + "alt" => ($alt ?? "") + ]; } } } else { @@ -589,12 +595,17 @@ class Linkinfo extends Controller unset($siteinfo["image"]); + $alt = $siteinfo["image_alt"]; + unset($siteinfo["image_alt"]); + $photodata = @getimagesize($src); if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10)) { $siteinfo["images"][] = ["src" => $src, "width" => $photodata[0], - "height" => $photodata[1]]; + "height" => $photodata[1], + "alt" => ($alt ?? '') + ]; } }