summaryrefslogtreecommitdiff
path: root/actions/newnotice.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-10-28 17:12:22 -0700
committerZach Copley <zach@status.net>2009-10-28 17:13:06 -0700
commite5a2f895a074a6eaaf8184f101503b1520ed780b (patch)
tree31427b7bfc8b7910aeaa1956fb2fa95a0dd82ced /actions/newnotice.php
parentb9ce23d0c2c1266b57997bd0d19891aa653d694c (diff)
Rearanged a couple things & removed debugging statements
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r--actions/newnotice.php26
1 files changed, 10 insertions, 16 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 5100e79e1..59fb9f461 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -164,27 +164,21 @@ class NewnoticeAction extends Action
}
$upload = null;
-
- common_debug('looking for attachment');
-
$upload = MediaFile::fromUpload('attach');
- common_debug("uploaded file = " . var_export($upload, true));
-
if (isset($upload)) {
- common_debug('newNotice: found an upload');
- $content_shortened .= ' ' . $upload->shortUrl();
+ $content_shortened .= ' ' . $upload->shortUrl();
- common_debug('content w/upload = ' . $content_shortened);
-
- if (Notice::contentTooLong($content_shortened)) {
- $upload->delete();
- $this->clientError(sprintf(_('Max notice size is %d chars, including attachment URL.'),
- Notice::maxContent()));
- } else {
- common_debug('content not too long');
- }
+ if (Notice::contentTooLong($content_shortened)) {
+ $upload->delete();
+ $this->clientError(
+ sprintf(
+ _('Max notice size is %d chars, including attachment URL.'),
+ Notice::maxContent()
+ )
+ );
+ }
}
$notice = Notice::saveNew($user->id, $content_shortened, 'web', 1,