Fixed new line issue with tinyMCE editor data
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 23 Mar 2015 18:56:45 +0000 (14:56 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 23 Mar 2015 18:56:45 +0000 (14:56 -0400)
lib/GlmDataAbstract/DataAbstract.php
views/admin/member/memberInfo.html

index 5fd3d3b..e7eaf11 100755 (executable)
@@ -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])));
         }
 
 
index ec971fc..cf18b80 100644 (file)
@@ -91,7 +91,7 @@
                 <th {if $memberInfo.fieldRequired.descr}class="glm-required"{/if}>Description:</th>
                 <td {if $memberInfo.fieldFail.descr}class="glm-form-bad-input"{/if}>
                     {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',