From 971d820a4e0291e1bce6ae02f810780047689308 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 27 Nov 2013 22:25:14 +0100 Subject: [PATCH 1/3] fromgplus: Picture posts had doubled content due to some strange unicode character. --- fromgplus/fromgplus.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index a6d3d84f..5269f7a0 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -101,6 +101,10 @@ function fromgplus_post($a, $uid, $source, $body, $location) { //$uid = 2; + // Don't know what it is. Maybe some trash from the mobile client + $trash = html_entity_decode("", ENT_QUOTES, 'UTF-8'); + $body = str_replace($trash, "", $body); + $body = trim($body); if (substr($body, 0, 3) == "[b]") { @@ -223,10 +227,14 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { } function fromgplus_cleantext($text) { + + // Don't know what it is. But it is added to the text. + $trash = html_entity_decode("", ENT_QUOTES, 'UTF-8'); + $text = strip_tags($text); $text = html_entity_decode($text); $text = trim($text); - $text = str_replace(array("\n", "\r", " "), array("", "", ""), $text); + $text = str_replace(array("\n", "\r", " ", $trash), array("", "", "", ""), $text); return($text); } From cf2f874db12fbf44c355a42afd21d1883f4f1748 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 27 Nov 2013 22:26:27 +0100 Subject: [PATCH 2/3] appnetpost: Avoiding a php warning --- appnetpost/appnetpost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appnetpost/appnetpost.php b/appnetpost/appnetpost.php index ca6d5d27..c1b1f175 100644 --- a/appnetpost/appnetpost.php +++ b/appnetpost/appnetpost.php @@ -371,7 +371,7 @@ function appnetpost_feeditem($pid, $uid) { $title = substr($title, 0, -3)."..."; } - if (!strstr($title, $msglink)) + if (($msglink != "") AND !strstr($title, $msglink)) $title = trim($title." ".$msglink); else $title = trim($title); From 1974b5d1a89dd8729dd2510e472717e2b7250dcf Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 27 Nov 2013 23:07:15 +0100 Subject: [PATCH 3/3] fromgplus: Don't fetch messages for the first time --- fromgplus/fromgplus.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 5269f7a0..711a73c3 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -330,6 +330,8 @@ function fromgplus_fetch($a, $uid) { $initiallastdate = get_pconfig($uid,'fromgplus','lastdate'); + $first_time = ($initiallastdate == ""); + $lastdate = 0; if (!is_array($activities->items)) @@ -344,6 +346,9 @@ function fromgplus_fetch($a, $uid) { if ($lastdate < strtotime($item->published)) $lastdate = strtotime($item->published); + if ($first_time) + continue; + if ($item->access->description == "Public") // Loop prevention - ignore postings from HootSuite