From b0dbf4d54c316d965974864cd75f68ed77021a9c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 6 Jul 2012 07:38:50 +0200 Subject: [PATCH] Twitter/Statusnet: Problem with vanishing linebreaks when message isn't shortened --- statusnet/statusnet.php | 7 ++++++- twitter/twitter.php | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 99e84475..b3a8a1a1 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -482,9 +482,14 @@ function statusnet_post_hook(&$a,&$b) { } // ok, all the links we want to send out are save, now strip // away the remaining bbcode - $msg = strip_tags(bbcode($tmp, false, false)); + //$msg = strip_tags(bbcode($tmp, false, false)); + $msg = bbcode($tmp, false, false); + $msg = str_replace(array('
','
'),"\n",$msg); + $msg = strip_tags($msg); + // quotes not working - let's try this $msg = html_entity_decode($msg); + if (( strlen($msg) > $max_char) && $max_char > 0) { $shortlink = short_link( $b['plink'] ); // the new message will be shortened such that "... $shortlink" diff --git a/twitter/twitter.php b/twitter/twitter.php index 9984f369..2849db96 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -347,7 +347,11 @@ function twitter_post_hook(&$a,&$b) { } // ok, all the links we want to send out are save, now strip // away the remaining bbcode - $msg = strip_tags(bbcode($tmp, false, false)); + //$msg = strip_tags(bbcode($tmp, false, false)); + $msg = bbcode($tmp, false, false); + $msg = str_replace(array('
','
'),"\n",$msg); + $msg = strip_tags($msg); + // quotes not working - let's try this $msg = html_entity_decode($msg); if (( strlen($msg) > $max_char) && $max_char > 0) {