X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fitems.php;h=e06df925e34ee9530c0c2f51d8c614175b00433b;hb=e0ecbd0b95454ed2ff4b0082b41d388d2938e3ae;hp=ee514c8fc414c37e2f86c1fd21ac3ceab0080297;hpb=4714cb746b6fb8e7bc4ae9676866c9da37af75af;p=friendica.git diff --git a/include/items.php b/include/items.php index ee514c8fc4..e06df925e3 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,9 +429,11 @@ 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]; $dnow = DateTimeFormat::utc($dnow . ' -1 month', 'Y-m-d'); }