]> git.mxchange.org Git - friendica-addons.git/commitdiff
Twitter/Statusnet: Problem with vanishing linebreaks when message isn't shortened
authorMichael Vogel <icarus@dabo.de>
Fri, 6 Jul 2012 05:38:50 +0000 (07:38 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 6 Jul 2012 05:38:50 +0000 (07:38 +0200)
statusnet/statusnet.php
twitter/twitter.php

index 99e84475276d4e5c775d15cd7d689d368be903db..b3a8a1a14e8534a48670c5d2347d4fbea3cea1c8 100755 (executable)
@@ -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('<br>','<br />'),"\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"
index 9984f3695885774547ef31850e097887e6cc4e8c..2849db968f8b1f1d41e5f2cbce1de9d913aef1e5 100755 (executable)
@@ -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('<br>','<br />'),"\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) {