fix regex #449
This commit is contained in:
parent
13f2a76032
commit
ef6aae127c
|
@ -119,7 +119,7 @@ class REST_Roles_Controller extends REST_Controller {
|
||||||
|
|
||||||
$role_slug = sanitize_title($name);
|
$role_slug = sanitize_title($name);
|
||||||
|
|
||||||
if( preg_match('/^[a-z0-9-_]*$/', $name) == false ) {
|
if( preg_match('/^[a-zA-Z0-9-_ ]*$/', $name) == false ) {
|
||||||
return new \WP_REST_Response([
|
return new \WP_REST_Response([
|
||||||
'error_message' => __('This role name is not allowed. Use only letters, numbers, underscore and hyphen', 'tainacan'),
|
'error_message' => __('This role name is not allowed. Use only letters, numbers, underscore and hyphen', 'tainacan'),
|
||||||
'error' => $name
|
'error' => $name
|
||||||
|
|
Loading…
Reference in New Issue