Is it ok to pass $_GET as a parameter of a constructor?
I’m guessing not but would like some constructive arguments that will hopefully raise the following please?
- Best strategy for dealing with $_GET at the client
- Security issues around $_GET
Thanks in advance for your interest.
Of course. The data in
$_GETis just like any other data. You just need to remember that data from the user can never be trusted.If your classes are sanitizing data for use, generally this isn’t an issue anyway. Just be extra cautious to avoid things such as SQL injections and XSS.