From 51f72d4fc104b018931c96a2bbe35fca24f26045 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 23 Mar 2015 14:56:45 -0400 Subject: [PATCH] Fixed new line issue with tinyMCE editor data --- lib/GlmDataAbstract/DataAbstract.php | 5 +++-- views/admin/member/memberInfo.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/GlmDataAbstract/DataAbstract.php b/lib/GlmDataAbstract/DataAbstract.php index 5fd3d3b7..e7eaf11b 100755 --- a/lib/GlmDataAbstract/DataAbstract.php +++ b/lib/GlmDataAbstract/DataAbstract.php @@ -1203,9 +1203,10 @@ abstract class GlmDataAbstract $in = filter_input(INPUT_POST, $as, $filter, $filter_options); - // Otherwise, if no filter is specified, use the standard WordPress wp_kses_post() function to to the filtering - Requires slashes removed first. + // Otherwise, if no filter is specified. } else { - $in = wp_kses_post(stripslashes($_POST[$as])); + // Kill slashes and use the standard WordPress wp_kses_post() function to to the filtering then apply nl2br() + $in = nl2br(wp_kses_post(stripslashes($_POST[$as]))); } diff --git a/views/admin/member/memberInfo.html b/views/admin/member/memberInfo.html index ec971fcb..cf18b807 100644 --- a/views/admin/member/memberInfo.html +++ b/views/admin/member/memberInfo.html @@ -91,7 +91,7 @@ Description: {php} - wp_editor('{$memberInfo.fieldData.descr|escape:quotes}', 'glm_descr', array( + wp_editor('{$memberInfo.fieldData.descr|escape:quotes|nl2br}', 'glm_descr', array( // 'media_buttons' => true, // 'quicktags' => false, 'textarea_name' => 'descr', -- 2.17.1