Sanitize GET data through PHP constructor

jfrag

New Member
I have the following constructor:\[code\]public function __construct(){ foreach($_GET as $key=>$value){ $_GET[$key] = addslashes($value); } $this->get = $_GET;}\[/code\]and it's used like so:\[code\]$app->get['id']\[/code\]Where 'id' is the parameter being passed through the URL.
Is there a good way to sanitize all the data through the constructor?
 
Back
Top