bugfix : is_numeric mal enchainé rendant la navigation impossible

This commit is contained in:
nojhan 2010-01-07 12:24:53 +00:00
commit 69bff74fcd

View file

@ -24,12 +24,18 @@ $cache = Cache::getCache();
// Obtain the id asked
$last = Cache::getLastId();
if (isset($_GET['id']) === true && is_numeric($id) === true) {
// Check if the id is valid, else use the last one
if (isset($_GET['id']) === true) { // is asked
$id = $_GET['id'];
if ($id > $last || $id < 0) {
if( is_numeric($id) === true) { // is numeric
if ($id > $last || $id < 0) { // is in bounds
$id = $last;
}
} else {
$id = $last;
}
} else {
$id = $last;
}
@ -65,4 +71,4 @@ if (isset($_GET['ajax']) === true) {
include_once Config::getTemplateFolder().'/stripit.xml';
} else {
include_once Config::getTemplateFolder().'/'.Config::getTemplateName().'/template.html';
}
}