summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-21 07:27:07 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-21 07:27:07 -0400
commit764a391d196287a9400ee597019c3e5207c5a5f0 (patch)
tree159f2cc26f3c415f67a4da821076865ec9cf6396 /lib/action.php
parent46b3f1c3a746044ae868c06bf3027e0a3ea27433 (diff)
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
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php5
1 files changed, 5 insertions, 0 deletions
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) {