X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=ab50e159a1898626ca202bddd1cef64b3f4caa63;hb=0360f7197aac062eb2fecf95969658ca56068deb;hp=ee514c8fc414c37e2f86c1fd21ac3ceab0080297;hpb=32ef5623ab8247162af93ef2f0bc6def6b2b8bf6;p=friendica.git diff --git a/include/items.php b/include/items.php index ee514c8fc4..ab50e159a1 100644 --- a/include/items.php +++ b/include/items.php @@ -33,6 +33,8 @@ function add_page_info_data($data, $no_photos = false) { $data["type"] = "link"; } + $data["title"] = defaults($data, "title", ""); + if ((($data["type"] != "link") && ($data["type"] != "video") && ($data["type"] != "photo")) || ($data["title"] == $data["url"])) { return ""; } @@ -47,19 +49,19 @@ function add_page_info_data($data, $no_photos = false) { $text = "[attachment type='".$data["type"]."'"; - if ($data["text"] == "") { + if (empty($data["text"])) { $data["text"] = $data["title"]; } - if ($data["text"] == "") { + if (empty($data["text"])) { $data["text"] = $data["url"]; } - if ($data["url"] != "") { + if (!empty($data["url"])) { $text .= " url='".$data["url"]."'"; } - if ($data["title"] != "") { + if (!empty($data["title"])) { $text .= " title='".$data["title"]."'"; } @@ -427,7 +429,7 @@ function list_post_dates($uid, $wall) { $start_month = DateTimeFormat::utc($dstart, 'Y-m-d'); $end_month = DateTimeFormat::utc($dend, 'Y-m-d'); $str = day_translate(DateTimeFormat::utc($dnow, 'F')); - if (!$ret[$dyear]) { + if (empty($ret[$dyear])) { $ret[$dyear] = []; } $ret[$dyear][] = [$str, $end_month, $start_month];