Skip to content

Commit

Permalink
fix(cbMap) control character error
Browse files Browse the repository at this point in the history
  • Loading branch information
denaldhushi committed Nov 25, 2022
1 parent fe1f549 commit d728797
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/cbMap/processmap/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,19 @@ public static function postProcess($function, $value) {
$value = $function($value, ENT_QUOTES, $default_charset);
break;
case 'json_decode':
$holdValue = $value;
$value = $function($value, true);
if (empty($value)) {
switch (json_last_error()) {
case JSON_ERROR_CTRL_CHAR:
$value = preg_replace("/\r|\n/", '\n', $holdValue);
$value = $function($value, true);
break;
default:
$value = null;
break;
}
}
break;
case 'json_encode':
$value = $function($value, JSON_NUMERIC_CHECK);
Expand Down

0 comments on commit d728797

Please sign in to comment.