From 69bff74fcd7e864f3729d323a78d4341540d2507 Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 7 Jan 2010 12:24:53 +0000 Subject: [PATCH] =?UTF-8?q?bugfix=20:=20is=5Fnumeric=20mal=20enchain=C3=A9?= =?UTF-8?q?=20rendant=20la=20navigation=20impossible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 67aba0a..7d45681 100644 --- a/index.php +++ b/index.php @@ -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'; -} \ No newline at end of file +}