bugfix : is_numeric mal enchainé rendant la navigation impossible
This commit is contained in:
parent
b72c3d21ed
commit
69bff74fcd
1 changed files with 10 additions and 4 deletions
10
index.php
10
index.php
|
|
@ -24,12 +24,18 @@ $cache = Cache::getCache();
|
||||||
// Obtain the id asked
|
// Obtain the id asked
|
||||||
$last = Cache::getLastId();
|
$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'];
|
$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;
|
$id = $last;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$id = $last;
|
$id = $last;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue