1
0
Fork 0

Merge pull request #5070 from Alkarex/sizeof-bug

sizeof bug
This commit is contained in:
Tobias Diekershoff 2018-05-17 07:43:18 +02:00 committed by GitHub
commit e107fae8e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,7 @@ function add_page_info_data($data, $no_photos = false) {
// It maybe is a rich content, but if it does have everything that a link has,
// then treat it that way
if (($data["type"] == "rich") && is_string($data["title"]) &&
is_string($data["text"]) && (sizeof($data["images"]) > 0)) {
is_string($data["text"]) && !empty($data["images"])) {
$data["type"] = "link";
}
@ -63,7 +63,7 @@ function add_page_info_data($data, $no_photos = false) {
$text .= " title='".$data["title"]."'";
}
if (sizeof($data["images"]) > 0) {
if (!empty($data["images"])) {
$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)