-
-
Save nappa32/1a7b1fb69f6d4714f55b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sanitise | |
{ | |
public function get($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_GET, $name, $filter, $options); | |
} | |
public function post($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_POST, $name, $filter, $options); | |
} | |
public function cookie($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_COOKIE, $name, $filter, $options); | |
} | |
public function server($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_SERVER, $name, $filter, $options); | |
} | |
public function env($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_ENV, $name, $filter, $options); | |
} | |
private funciton sanitise($type, $name, $filter, $options=null) | |
{ | |
return filter_input($type, $name, $filter, $options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment