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/subscribe.php | |
parent | 5d1a6f0fef3b99167babfa304ceda9b67720f399 (diff) |
call validate before saving objects
darcs-hash:20080520191032-84dde-64197121c93cd4cf3cbc614badff0bd44547f9f9.gz
Diffstat (limited to 'actions/subscribe.php')
-rw-r--r-- | actions/subscribe.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actions/subscribe.php b/actions/subscribe.php index 4edf3e714..ea3038236 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -49,6 +49,14 @@ class SubscribeAction extends Action { $sub->subscribed = $other->id; $sub->created = DB_DataObject_Cast::dateTime(); # current time + + $val = $sub->validate(); + + if ($val !== TRUE) { + # XXX: give some error notice + common_server_error(_t('Subscription did not validate.')); + return; + } if (!$sub->insert()) { common_server_error(_t('Couldn\'t create subscription.')); |