mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Fix Feature Issue ID 0000608: crash when asking random images with no images are allowed
git-svn-id: http://piwigo.org/svn/trunk@1681 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -247,13 +247,24 @@ else if ('list' == $tokens[$next_token])
|
||||
$next_token++;
|
||||
|
||||
$page['list'] = array();
|
||||
if (!preg_match('/^\d+(,\d+)*$/', $tokens[$next_token]))
|
||||
|
||||
// No pictures
|
||||
if (empty($tokens[$next_token]))
|
||||
{
|
||||
die('wrong format on list GET parameter');
|
||||
// Add dummy element list
|
||||
array_push($page['list'], -1);
|
||||
}
|
||||
foreach (explode(',', $tokens[$next_token]) as $image_id)
|
||||
// With pictures list
|
||||
else
|
||||
{
|
||||
array_push($page['list'], $image_id);
|
||||
if (!preg_match('/^\d+(,\d+)*$/', $tokens[$next_token]))
|
||||
{
|
||||
die('wrong format on list GET parameter');
|
||||
}
|
||||
foreach (explode(',', $tokens[$next_token]) as $image_id)
|
||||
{
|
||||
array_push($page['list'], $image_id);
|
||||
}
|
||||
}
|
||||
$next_token++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user