From c09db79b9581894b39c0368a1c36f6de16b6f0f6 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 18 Mar 2010 13:46:11 -0700 Subject: Remove deprecated call-by-reference. Was causing a warning on Dreamhost. --- actions/sitenoticeadminpanel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/sitenoticeadminpanel.php b/actions/sitenoticeadminpanel.php index 3931aa982..a68cc699c 100644 --- a/actions/sitenoticeadminpanel.php +++ b/actions/sitenoticeadminpanel.php @@ -93,7 +93,7 @@ class SitenoticeadminpanelAction extends AdminPanelAction // assert(all values are valid); // This throws an exception on validation errors - $this->validate(&$siteNotice); + $this->validate($siteNotice); $config = new Config(); -- cgit v1.2.3-54-g00ecf From e10d023d037ac9d2a628f8246dfccb4ad525ed59 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 18 Mar 2010 15:26:13 -0700 Subject: API - handle any exceptions thrown during notice save. The API was occasionally spitting out HTML, which is hard for clients to deal with. --- actions/apistatusesupdate.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'actions') diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index bf367e1e1..1956c8586 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -244,11 +244,17 @@ class ApiStatusesUpdateAction extends ApiAuthAction $options = array_merge($options, $locOptions); } - $this->notice = - Notice::saveNew($this->auth_user->id, - $content, - $this->source, - $options); + try { + $this->notice = Notice::saveNew( + $this->auth_user->id, + $content, + $this->source, + $options + ); + } catch (Exception $e) { + $this->clientError($e->getMessage()); + return; + } if (isset($upload)) { $upload->attachToNotice($this->notice); -- cgit v1.2.3-54-g00ecf From 01a1e882afeb78542b02e4643c5d8a2fa50c2206 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 18 Mar 2010 17:18:01 -0700 Subject: Handle "forgot to upload an avatar on avatarsettings" a little more gracefully. --- actions/avatarsettings.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actions') diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 6a7398746..d4ea11cb7 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -301,6 +301,10 @@ class AvatarsettingsAction extends AccountSettingsAction $this->showForm($e->getMessage()); return; } + if ($imagefile === null) { + $this->showForm(_('No file uploaded.')); + return; + } $cur = common_current_user(); -- cgit v1.2.3-54-g00ecf