+ return ["header" => $author, "items" => $items];
+ }
+
+ private static function titleIsBody($title, $body)
+ {
+ $title = strip_tags($title);
+ $title = trim($title);
+ $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
+ $title = str_replace(["\n", "\r", "\t", " "], ["", "", "", ""], $title);
+
+ $body = strip_tags($body);
+ $body = trim($body);
+ $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8');
+ $body = str_replace(["\n", "\r", "\t", " "], ["", "", "", ""], $body);
+
+ if (strlen($title) < strlen($body)) {
+ $body = substr($body, 0, strlen($title));
+ }
+
+ if (($title != $body) && (substr($title, -3) == "...")) {
+ $pos = strrpos($title, "...");
+ if ($pos > 0) {
+ $title = substr($title, 0, $pos);
+ $body = substr($body, 0, $pos);
+ }