]> git.mxchange.org Git - friendica.git/commitdiff
fix_mce_lf on profiles
authorfriendica <info@friendica.com>
Tue, 10 Apr 2012 23:31:49 +0000 (16:31 -0700)
committerfriendica <info@friendica.com>
Tue, 10 Apr 2012 23:31:49 +0000 (16:31 -0700)
include/text.php
mod/profiles.php

index aced9e0a81471bd4b22900a315a32131b57bca8b..4ec59a66589c05ec8509d53da9e37ec46741fc79 100644 (file)
@@ -1506,3 +1506,8 @@ function undo_post_tagging($s) {
        return $s;
 }
 
+function fix_mce_lf($s) {
+       $s = str_replace("\r\n","\n",$s);
+       $s = str_replace("\n\n","\n",$s);
+       return $s;
+}
\ No newline at end of file
index 7b3b6ccc1eb5ea1451bcf361768c53f73f117379..20be43d5d4b576fe5669215a8d7804d90d4a9982 100644 (file)
@@ -121,16 +121,17 @@ function profiles_post(&$a) {
                $politic = notags(trim($_POST['politic']));
                $religion = notags(trim($_POST['religion']));
 
-               $about = escape_tags(trim($_POST['about']));
-               $interest = escape_tags(trim($_POST['interest']));
-               $contact = escape_tags(trim($_POST['contact']));
-               $music = escape_tags(trim($_POST['music']));
-               $book = escape_tags(trim($_POST['book']));
-               $tv = escape_tags(trim($_POST['tv']));
-               $film = escape_tags(trim($_POST['film']));
-               $romance = escape_tags(trim($_POST['romance']));
-               $work = escape_tags(trim($_POST['work']));
-               $education = escape_tags(trim($_POST['education']));
+               $about = fix_mce_lf(escape_tags(trim($_POST['about'])));
+               $interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
+               $contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
+               $music = fix_mce_lf(escape_tags(trim($_POST['music'])));
+               $book = fix_mce_lf(escape_tags(trim($_POST['book'])));
+               $tv = fix_mce_lf(escape_tags(trim($_POST['tv'])));
+               $film = fix_mce_lf(escape_tags(trim($_POST['film'])));
+               $romance = fix_mce_lf(escape_tags(trim($_POST['romance'])));
+               $work = fix_mce_lf(escape_tags(trim($_POST['work'])));
+               $education = fix_mce_lf(escape_tags(trim($_POST['education'])));
+
                $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
 
                $r = q("UPDATE `profile`