Small code fixes in API code

This commit is contained in:
2026-06-15 16:04:21 +02:00
parent 7429cd367d
commit 16be5448be
20 changed files with 64 additions and 75 deletions

View File

@@ -24,7 +24,7 @@ if ($API_mailsettings->request_method === 'PUT') {
'mail_smtp_pass' => ['type' => 'string']
];
# check if the password is changed
$updatePassword = str_contains($API_mailsettings->postedData['mail_smtp_pass'], '******') ? false : true;
$updatePassword = !str_contains($API_mailsettings->postedData['mail_smtp_pass'], '******');
if ($updatePassword) {
if (strlen($API_mailsettings->postedData['mail_smtp_pass']) < 12) {
$API_mailsettings->apiOutput(400, ['error' => 'Password too short']);