Merge pull request #13490 from ptibogxiv/patch-319
FIX preg_match for constante name
This commit is contained in:
commit
e7360279b5
@ -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');
|
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');
|
throw new RestException(500, 'Error Bad or unknown value for constname');
|
||||||
}
|
}
|
||||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) {
|
if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user