mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-10 18:53:01 +02:00
related to #1524 Input verification
This commit is contained in:
@@ -75,6 +75,10 @@ SELECT COUNT(*)
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'This name is already used by another group.');
|
||||
}
|
||||
|
||||
if (strlen(str_replace( " ", "", $params['name'])) == 0) {
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'Name field must not be empty');
|
||||
}
|
||||
|
||||
// creating the group
|
||||
single_insert(
|
||||
GROUPS_TABLE,
|
||||
@@ -127,6 +131,10 @@ function ws_groups_setInfo($params, &$service)
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
if (strlen(str_replace( " ", "", $params['name'])) == 0) {
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'Name field must not be empty');
|
||||
}
|
||||
|
||||
$updates = array();
|
||||
|
||||
// does the group exist ?
|
||||
|
||||
@@ -362,6 +362,10 @@ function ws_users_add($params, &$service)
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
if (strlen(str_replace( " ", "", $params['username'])) == 0) {
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'Name field must not be empty');
|
||||
}
|
||||
|
||||
global $conf;
|
||||
|
||||
if ($conf['double_password_type_in_admin'])
|
||||
@@ -493,6 +497,10 @@ function ws_users_setInfo($params, &$service)
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
if (strlen(str_replace( " ", "", $params['username'])) == 0) {
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'Name field must not be empty');
|
||||
}
|
||||
|
||||
global $conf, $user;
|
||||
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||
|
||||
Reference in New Issue
Block a user