]> git.mxchange.org Git - friendica-addons.git/commitdiff
fromgplus: Further tests so that text isn't sent twice.
authorMichael Vogel <icarus@dabo.de>
Sat, 24 Aug 2013 17:33:50 +0000 (19:33 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 24 Aug 2013 17:33:50 +0000 (19:33 +0200)
fromgplus/fromgplus.php

index 59b20023fd177f15f86612f511582188f6696e58..9fc13c5ec97e8bad1946831d7cf9a5514d938ae7 100644 (file)
@@ -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;