Jump to content

is there any sanitizer for page id ?


adrianmak
 Share

Recommended Posts

$sanitizer->int() or php natives (int) or intval() will do.

post-1041-0-33961000-1460718814_thumb.jp

Looking up in tools like API-gen, maintained (with everytime the newest codebase) by Kongondo, is much more faster than asking (such simply code/method related things) in the forums. :)

I highly suggest to use this. It will save you a lot of time, that you otherwise have to wait until someone other answers your questions. :)

---

EDIT: Oh damn, - @arjen beats me, while I made the screenshot!

  • Like 5
Link to comment
Share on other sites

Soma is right here. It isn't enough to sanitize to an integer, you also need to add some own logic, that reflects what you are expecting. :)

What I exactly meant is: sanitizing with intUnsigned() and add some own logic (template or equal). :)

Link to comment
Share on other sites

Ah yes right, negative evals to true.

So then correcting mine: :D

if($id > 0){...} 

But don't see why that would be an issue to have a negative page id it won't find it anyway.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...