Update api_setup.class.php

This commit is contained in:
ptibogxiv 2020-04-05 10:50:38 +02:00 committed by GitHub
parent 99e53f6b18
commit 7818b15151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1426,7 +1426,7 @@ class Setup extends DolibarrApi
throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK');
}
if (! preg_match('/[a-zA-Z0-9_]/', $confname) || ! isset($conf->global->$confname)) {
if (! preg_match('/^[a-zA-Z0-9_]+$/', $confname) || ! isset($conf->global->$confname)) {
throw new RestException(500, 'Error Bad or unknown value for constname');
}
if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) {