From 764a391d196287a9400ee597019c3e5207c5a5f0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 21 May 2008 07:27:07 -0400 Subject: validation in form handlers Moved validation code from classes to form handlers. Probably better in the classes, but I can't quite grok the validate() method in DB_DataObject, so for now I'm going to do it the old-fashioned way. darcs-hash:20080521112707-84dde-38e27199b977ae81171b8391fbdb93ebb54494f9.gz --- lib/action.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/action.php b/lib/action.php index 8d4a0b7ab..9b7988a19 100644 --- a/lib/action.php +++ b/lib/action.php @@ -34,6 +34,11 @@ class Action { // lawsuit } } + function trimmed($key) { + $arg = $this->arg($key); + return (is_string($arg)) ? trim($arg) : $arg; + } + function handle($argarray) { $this->args = array(); foreach ($argarray as $k => $v) { -- cgit v1.2.3-54-g00ecf