acsconfig boolean writing without quotes

This commit is contained in:
Martijn Scheepers
2019-01-29 13:48:08 +01:00
parent 1cdaf26a86
commit 0ec379a6a4
2 changed files with 6 additions and 2 deletions

View File

@@ -87,7 +87,7 @@
<label class="w3-label">Relay invert</label>
<input class="w3-check" type="hidden" name="relayinvert" value="false" >
<input class="w3-check" type="checkbox" name="relayinvert" value="true"
<?php if($settings['relayinvert'] == "true"){
<?php if($settings['relayinvert'] == true){
echo "checked";
}
?>>

View File

@@ -2,7 +2,11 @@
function write_php_ini($array, $file){
$res = array();
foreach($array as $key => $val){
$res[] = "$key=".(is_numeric($val) ? $val : '"'.$val.'"');
if($val == "true" || $val == "false"){
$res[] = "$key=$val";
}else{
$res[] = "$key=".(is_numeric($val) ? $val : '"'.$val.'"');
}
}
return safefilerewrite($file, implode("\n", $res));
}