summaryrefslogtreecommitdiff
path: root/actions/newnotice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-26 13:22:51 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-02-26 13:22:51 -0800
commit34a61b40f47a52d1fdcf7cd907f3ac53b96b038e (patch)
tree14ddeb18d9e020760d8c2308a12d858b6eab4a17 /actions/newnotice.php
parent478192fa3b2375a0ff0a5ff03956381e5da7a6ac (diff)
parent8c3fe83c645265a11a3fca80cac2ac48ea72cdab (diff)
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r--actions/newnotice.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 5e7691f33..9face9644 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -98,7 +98,12 @@ class NewnoticeAction extends Action
return;
}
- $this->saveNewNotice();
+ try {
+ $this->saveNewNotice();
+ } catch (Exception $e) {
+ $this->showForm($e->getMessage());
+ return;
+ }
} else {
$this->showForm();
}
@@ -123,15 +128,13 @@ class NewnoticeAction extends Action
$content = $this->trimmed('status_textarea');
if (!$content) {
- $this->showForm(_('No content!'));
- return;
+ $this->clientError(_('No content!'));
} else {
$content_shortened = common_shorten_links($content);
if (mb_strlen($content_shortened) > 140) {
- $this->showForm(_('That\'s too long. '.
- 'Max notice size is 140 chars.'));
- return;
+ $this->clientError(_('That\'s too long. '.
+ 'Max notice size is 140 chars.'));
}
}
@@ -154,7 +157,7 @@ class NewnoticeAction extends Action
($replyto == 'false') ? null : $replyto);
if (is_string($notice)) {
- $this->showForm($notice);
+ $this->clientError($notice);
return;
}