Merge pull request #5706 from annando/width-notice

Invalid pictures could lead to notices, this is removed now
pull/5709/head
Hypolite Petovan 2018-08-31 05:01:54 -04:00 zatwierdzone przez GitHub
commit 7459a998e4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -72,7 +72,8 @@ function add_page_info_data(array $data, $no_photos = false)
$text .= " title='".$data["title"]."'";
}
if (!empty($data["images"])) {
// Only embedd a picture link when it seems to be a valid picture ("width" is set)
if (!empty($data["images"]) && !empty($data["images"][0]["width"])) {
$preview = str_replace(["[", "]"], ["[", "]"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode
// But only, if the picture isn't higher than large (To prevent huge posts)