frameworkers/furnace — Issue #5: Provide a way to clean a single arbitrary input value
Author: andrewfhart
Created: 2012-02-06 05:59:12+00:00
State: open

The `furnace\controller\Input` class provides the means to access sanitized versions of any user-provided input submitted via either $_GET or $_POST. Because Furnace supports passing parameters as url segments (which get mapped to controller handler function parameters), it is good practice to sanitize these values as well. Currently, however, the `furnace\controller\Input` class does not provide a convenient mechanism for doing so. This issue proposes adding the `Clean` method, which could be used as in the following hypothetical scenario:

```
function myHandler( $param1, $param2 ) {
$sql = "SELECT * FROM foo WHERE bar=:bar AND baz=:baz";
$stmt = Connections::Get()->prepare($sql);
$stmt->execute(array(
'bar' => Input::Clean($param1)
,'baz' => Input::Clean($param2)
));
...
}