mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-10-30 21:52:00 +01:00
fixes GHSA-hq29-8hhx-5jwc [search] check input parameter ratings
This commit is contained in:
1 parent
2357a86d51
commit
9755d88edf
2 files changed
+9
-1
No files matched your search
@@ -637,7 +637,7 @@ SELECT
|
||||
}
|
||||
else
|
||||
{
|
||||
$filter_clauses[] = '(rating_score >= '.(intval($r)-1).' AND rating_score < '.$r.')';
|
||||
$filter_clauses[] = '(rating_score >= '.(intval($r)-1).' AND rating_score < '.intval($r).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1039,6 +1039,14 @@ function ws_images_filteredSearch_create($params, $service)
|
||||
|
||||
if ($conf['rate'] and isset($params['ratings']))
|
||||
{
|
||||
foreach ($params['ratings'] as $rate)
|
||||
{
|
||||
if (!preg_match('/^\d+$/i', $rate))
|
||||
{
|
||||
return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid parameter ratings');
|
||||
}
|
||||
}
|
||||
|
||||
$search['fields']['ratings'] = $params['ratings'];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user