File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,9 @@ private function checkBeforeSave($input) : array {
402402 * @return array the modified $input array
403403 */
404404 public function prepareInputForAdd ($ input ) {
405- $ input ['default_values ' ] = str_replace ('\r\n ' , '' , $ input ['default_values ' ]);
405+ if (!empty ($ input ['default_values ' ])) {
406+ $ input ['default_values ' ] = str_replace ('\r\n ' , '' , $ input ['default_values ' ]);
407+ }
406408
407409 if (!$ this ->skipChecks ) {
408410 $ input = $ this ->checkBeforeSave ($ input );
@@ -454,7 +456,9 @@ public function prepareInputForAdd($input) {
454456 public function prepareInputForUpdate ($ input ) {
455457 // global $DB;
456458
457- $ input ['default_values ' ] = str_replace ('\r\n ' , '' , $ input ['default_values ' ]);
459+ if (!empty ($ input ['default_values ' ])) {
460+ $ input ['default_values ' ] = str_replace ('\r\n ' , '' , $ input ['default_values ' ]);
461+ }
458462 if (!$ this ->skipChecks ) {
459463 if (!isset ($ input ['plugin_formcreator_sections_id ' ])) {
460464 $ input ['plugin_formcreator_sections_id ' ] = $ this ->fields ['plugin_formcreator_sections_id ' ];
You can’t perform that action at this time.
0 commit comments