fix error in editting config
parent
dd8c56179f
commit
7f0e1d96ce
|
@ -152,7 +152,7 @@ function setConfig($arr, $disktag = '')
|
||||||
foreach ($tmp as $key => $val) {
|
foreach ($tmp as $key => $val) {
|
||||||
if (!!$val) $response = ReplitAPI('w', $key, $val);
|
if (!!$val) $response = ReplitAPI('w', $key, $val);
|
||||||
else $response = ReplitAPI('d', $key);
|
else $response = ReplitAPI('d', $key);
|
||||||
if (api_error($response)) return ['stat'=>500, 'body'=>$response['body']];
|
if (api_error($response)) return ['stat'=>$response['stat'], 'body'=>$response['body'] . "<br>\nError in writting " . $key . "=" . $val];
|
||||||
}
|
}
|
||||||
//error_log1(json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp:' . json_encode($tmp, JSON_PRETTY_PRINT));
|
//error_log1(json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp:' . json_encode($tmp, JSON_PRETTY_PRINT));
|
||||||
return $response;
|
return $response;
|
||||||
|
@ -286,7 +286,7 @@ function ConfigWriteable()
|
||||||
|
|
||||||
function api_error($response)
|
function api_error($response)
|
||||||
{
|
{
|
||||||
return !($response['stat']==200||$response['stat']==204);
|
return !($response['stat']==200||$response['stat']==204||$response['stat']==404);
|
||||||
//return isset($response['message']);
|
//return isset($response['message']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue