From: Michael Vogel Date: Sat, 24 Aug 2013 17:33:50 +0000 (+0200) Subject: fromgplus: Further tests so that text isn't sent twice. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3de94114ea33669abe0e211c629c1ca98f274599;p=friendica-addons.git fromgplus: Further tests so that text isn't sent twice. --- diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 59b20023..9fc13c5e 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -218,6 +218,14 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { return($cleaned); } +function fromgplus_cleantext($text) { + $text = strip_tags($text); + $text = html_entity_decode($text); + $text = trim($text); + $text = str_replace(array("\n", "\r", " "), array("", "", ""), $text); + return($text); +} + function fromgplus_handleattachments($item, $displaytext) { $post = ""; $quote = ""; @@ -259,7 +267,7 @@ function fromgplus_handleattachments($item, $displaytext) { elseif ($images["full"] != "") $post .= "\n[img]".$images["full"]."[/img]\n"; - if (($attachment->displayName != "") AND (trim($attachment->displayName) != trim(strip_tags($displaytext)))) + if (($attachment->displayName != "") AND (fromgplus_cleantext($attachment->displayName) != fromgplus_cleantext($displaytext))) $post .= fromgplus_html2bbcode($attachment->displayName)."\n"; break;