diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 524591e241c..fe55987a77a 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -35,6 +35,9 @@ $entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity; $original_file = GETPOST("file", "alpha"); $l = GETPOST('l', 'aZ09'); $limit = GETPOSTINT('limit'); +if ($limit <= 0 || $limit > 100) { + $limit = 20; +} $cachedelay = GETPOSTINT('cachedelay'); // The delay in second of the cache // Parameters for RSS @@ -131,7 +134,7 @@ if ($rss) { $filters['lang'] = $l; } - $MAXNEWS = ($limit ? $limit : 20); + $MAXNEWS = $limit; $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters); $eventarray = array(); if (is_array($arrayofblogs)) {