This commit is contained in:
parent
4755e666c7
commit
4a8afe89d0
19
catalog.php
19
catalog.php
|
|
@ -12,8 +12,27 @@ if (isset($_SESSION['user'])) {
|
||||||
$user = new User($con, $_SESSION['user']);
|
$user = new User($con, $_SESSION['user']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$possiblePages = [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11
|
||||||
|
];
|
||||||
|
|
||||||
if(isset($_GET["p"])) {
|
if(isset($_GET["p"])) {
|
||||||
$page = (int) $_GET["p"];
|
$page = (int) $_GET["p"];
|
||||||
|
if(!in_array($page,$possiblePages)) {
|
||||||
|
header('location: /catalog');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue