mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 02:03:18 +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 ?
|
||||
|
||||
Reference in New Issue
Block a user