Created
August 19, 2010 13:13
-
-
Save luniki/537837 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
<?php | |
require 'authenticated_controller.php'; | |
class SheriffController extends AuthenticatedController | |
{ | |
function index_action() | |
{ | |
$args = func_get_args(); | |
var_dump(__METHOD__, $args); | |
$this->render_nothing(); | |
} | |
function before_filter(&$action, &$args) | |
{ | |
parent::before_filter($action, $args); | |
$args = $this->filterArgs($args); | |
} | |
// override this to implement your own filtering | |
function filterArgs($args) | |
{ | |
foreach ($args as $arg) { | |
if (preg_match('/[^a-zA-Z0-9]/', $arg)) { | |
throw new Trails_Exception(400); | |
} | |
} | |
return $args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment