fromgplus: Further tests so that text isn't sent twice.

pull/146/head
Michael Vogel 2013-08-24 19:33:50 +02:00
parent a3253a3c85
commit 3de94114ea
1 changed files with 9 additions and 1 deletions

View File

@ -218,6 +218,14 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
return($cleaned); 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) { function fromgplus_handleattachments($item, $displaytext) {
$post = ""; $post = "";
$quote = ""; $quote = "";
@ -259,7 +267,7 @@ function fromgplus_handleattachments($item, $displaytext) {
elseif ($images["full"] != "") elseif ($images["full"] != "")
$post .= "\n[img]".$images["full"]."[/img]\n"; $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"; $post .= fromgplus_html2bbcode($attachment->displayName)."\n";
break; break;