mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-07 16:55:51 +03:00
related to #1524 Input verification
This commit is contained in:
parent
b409841e0f
commit
d8862e43ac
5 changed files with 60 additions and 30 deletions
|
@ -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 ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue