From e5a2f895a074a6eaaf8184f101503b1520ed780b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 28 Oct 2009 17:12:22 -0700 Subject: Rearanged a couple things & removed debugging statements --- actions/newnotice.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'actions/newnotice.php') 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, -- cgit v1.2.3-54-g00ecf