Skip to content

Instantly share code, notes, and snippets.

@luniki
Created August 19, 2010 13:13
Show Gist options
  • Save luniki/537837 to your computer and use it in GitHub Desktop.
Save luniki/537837 to your computer and use it in GitHub Desktop.
<?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