That is fairly standard don't worry about it. FedEx don't seem too worried about it and their I.t. people make well over $100,000 a year.
I just tested that very thing on this forum, and if you go past the last page @JeffreyWay just has a little message there. But really it's no big deal.
And before @tykus_ikus tries to beat me with a better answer hi hi, some people will set the paginator up so if you go past the last page it will automatically go to the last page.
If page pagination is greater than..
Hi, Im using the built in simple pagination with custom css. As you are probably aware, Laravel appends the pagation page ids to the url when using pagination, However if some malicious user as such wants to try and get technical, Lets say we have the following setup:
and now we have added 3 pages of pagination
http://example.com/article?page=1 http://example.com/article?page=2 http://example.com/article?page=3
he or she can then add the following: ?page=30 and so on...
Though this does not break the site it will stop rendering the pagination results because there is not for page 30 and so on... So i wanted to add something simple to my controller maybe an if statement to say count the pagination number given by laravel using: $reviews->hasMorePages() or even $reviews->count() then use something like this:
$pageID = $_GET['page']; $reviewCount = $reviews->count(); if($pageID > $reviewCount){ return redirect->back(); }
Excuse the code as ive not tested it in any way i have just quickly typed it out as im writing this message so the syntax may be a bit ski wiff!
Any suggestions on the best approach here? Im basically trying to verify that the page parameter is not greater than the $pagination->count() function and if it is then its been modified manually or maliciously so redirect back or redirect to first page / article page.
Thanks
Please or to participate in this conversation.