]> git.mxchange.org Git - friendica.git/commitdiff
work around doubled linefeeds in tinymce3.5b2
authorfriendica <info@friendica.com>
Thu, 22 Mar 2012 04:42:27 +0000 (21:42 -0700)
committerfriendica <info@friendica.com>
Thu, 22 Mar 2012 04:42:27 +0000 (21:42 -0700)
mod/item.php

index fe570075f2f6eca655909f6e063bd3e18295236e..ee6c5c9a7390ff69418f4f91afefeb626bd0d7f9 100755 (executable)
@@ -243,6 +243,7 @@ function item_post(&$a) {
                }
 
 
+
                if(! strlen($body)) {
                        if($preview)
                                killme();
@@ -253,6 +254,15 @@ function item_post(&$a) {
                }
        }
 
+       // Work around doubled linefeeds in Tinymce 3.5b2
+       // First figure out if it's a status post that would've been
+       // created using tinymce. Otherwise leave it alone. 
+
+       $plaintext = (local_user() ? intval(get_pconfig(local_user(),'system','plaintext')) : 0);
+       if((! $parent) && (! $api_source) && (! $plaintext)) {
+               $body = str_replace("\r\n","\n",$body);
+               $body = str_replace("\n\n","\n",$body);
+       }
 
 
        // get contact info for poster