aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2023-10-22 16:15:33 -0400
committerSquibid <me@zacharyscheiman.com>2023-10-22 16:15:33 -0400
commit4a6dcea04493750b43c2d27b318d1777ebb886d2 (patch)
treeea8e3921624a3e87b02b7e9886dff5d3bed76b3a
parent995dc3dc88cb6dbcb249b8ea2c5789c0287fa662 (diff)
downloadwallheaven-4a6dcea04493750b43c2d27b318d1777ebb886d2.tar.gz
wallheaven-4a6dcea04493750b43c2d27b318d1777ebb886d2.tar.bz2
wallheaven-4a6dcea04493750b43c2d27b318d1777ebb886d2.zip
make sure there is only one page specified in uri
Diffstat (limited to '')
-rw-r--r--query.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/query.php b/query.php
index 9722bb6..41cc918 100644
--- a/query.php
+++ b/query.php
@@ -35,13 +35,15 @@
return;
printf("<br>\n<div id='footer'>\n");
+ $_SERVER['REQUEST_URI'] = preg_replace("/&page=[0-9]+/i", "",
+ $_SERVER['REQUEST_URI']);
if ($page > 1)
printf("<a href='%s&page=1'><<</a> <a href='%s&page=%d'><</a> ",
$_SERVER['REQUEST_URI'], $_SERVER['REQUEST_URI'], $page - 1);
for ($i = $page; $i <= ($res[1]["pages"] > $page + 10 ? $page + 10 : $res[1]["pages"]); $i++)
printf("<a href='%s&page=%d'>%d</a> ", $_SERVER['REQUEST_URI'], $i, $i);
if ($page != $res[1]["pages"])
- printf("<a href='%s&page=%d'>></a> <a href='%s&page=%d'>>></a> ",
+ printf("<a href='%s&page=%s'>></a> <a href='%s&page=%s'>>></a> ",
$_SERVER['REQUEST_URI'], $page + 1, $_SERVER['REQUEST_URI'],
$res[1]["pages"]);
printf("</div>\n<br><br>\n");