fix error in editting config

pull/493/head
qkqpttgf 2021-12-12 13:39:04 +00:00 committed by GitHub
parent dd8c56179f
commit 7f0e1d96ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ function setConfig($arr, $disktag = '')
foreach ($tmp as $key => $val) {
if (!!$val) $response = ReplitAPI('w', $key, $val);
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));
return $response;
@ -286,7 +286,7 @@ function ConfigWriteable()
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']);
}