Skip to content

Commit

Permalink
Bugfix for settings dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
fr committed Feb 2, 2023
1 parent c48dad1 commit b355180
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion g_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
}

if (is_array($rc_keys)) foreach ($rc_keys as $condition) {
$g_settings["reaction_conditions"][$condition]=$_REQUEST[$condition];
$g_settings["reaction_conditions"][$condition]=$_REQUEST[$condition]??null;
}
unset($g_settings["order_system"]); // crazy bug
unset($g_settings["use_java_upload"]);
Expand Down
14 changes: 13 additions & 1 deletion lib_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,22 @@ function getSubitemlistObject0($list_int_name,$fields,$index,$allowSomeHtml) {
}

function breakArray($arr) {
if (is_array($arr)) {
foreach ($arr as $idx => $entry) {
$arr[$idx]=breakArray($entry);
}
return $arr;
}
return str_replace(array(",","\n","\r"),array(","),$arr);
}

function unbreakArray($arr) {
if (is_array($arr)) {
foreach ($arr as $idx => $entry) {
$arr[$idx]=unbreakArray($entry);
}
return $arr;
}
return str_replace(array(" ","\n","\r"),"",$arr);
}

Expand All @@ -88,7 +100,7 @@ function applyImgSetting($names) {
function applySettings(& $arr,$names,$keys) {
foreach ($names as $name) {
foreach ($keys as $key) {
$arr[$name][$key]=$_REQUEST[$name."_".$key];
$arr[$name][$key]=$_REQUEST[$name."_".$key]??null;
}
}
}
Expand Down

0 comments on commit b355180

Please sign in to comment.