diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-05-20 15:10:32 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-05-20 15:10:32 -0400 |
commit | 3f5ededc01d8eedac2a9a75917849fbe78a3e701 (patch) | |
tree | 50627d9a90854d51f52fa398b044046b382fe3c8 /actions/newnotice.php | |
parent | 5d1a6f0fef3b99167babfa304ceda9b67720f399 (diff) |
call validate before saving objects
darcs-hash:20080520191032-84dde-64197121c93cd4cf3cbc614badff0bd44547f9f9.gz
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r-- | actions/newnotice.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index fed3278a4..5bbc91531 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -49,7 +49,14 @@ class NewnoticeAction extends Action { $notice->profile_id = $user->id; # user id *is* profile id $notice->created = DB_DataObject_Cast::dateTime(); $notice->content = trim($this->arg('content')); - return $notice->insert(); + + $val = $notice->validate(); + if ($val === TRUE) { + return $notice->insert(); + } else { + // XXX: display some info + return NULL; + } } function show_form() { |