From c00491cd7a29a9ef16d6e6bfa54505d4c9a522fe Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 10 Mar 2014 00:19:35 +0100 Subject: [PATCH] Cosmetic changes to common_redirect, clientError, serverError Since these functions exit (or throw exception) after running, there is no need to have a 'return' statement or similar afterwards. --- actions/addpeopletag.php | 5 ----- actions/allrss.php | 1 - actions/apiaccountupdatedeliverydevice.php | 3 --- actions/apiaccountupdateprofile.php | 2 -- actions/apiaccountverifycredentials.php | 1 - actions/apifriendshipsshow.php | 3 --- actions/apimediaupload.php | 4 ---- actions/apioauthaccesstoken.php | 1 - actions/apistatusesshow.php | 4 ---- actions/approvegroup.php | 12 +----------- actions/approvesub.php | 2 -- actions/atompubshowsubscription.php | 1 - actions/atompubsubscriptionfeed.php | 6 ------ actions/attachment.php | 1 - actions/avatarsettings.php | 3 --- actions/block.php | 2 -- actions/blockedfromgroup.php | 4 ---- actions/cancelgroup.php | 11 +---------- actions/cancelsubscription.php | 5 ----- actions/confirmaddress.php | 11 ----------- actions/deleteapplication.php | 4 ---- actions/deletegroup.php | 9 +-------- actions/deleteuser.php | 2 -- actions/editapplication.php | 3 --- actions/editgroup.php | 9 +-------- actions/editpeopletag.php | 10 +--------- actions/emailsettings.php | 4 ---- actions/favoritesrss.php | 1 - actions/foaf.php | 4 ---- actions/foafgroup.php | 3 --- actions/getfile.php | 2 -- actions/grantrole.php | 4 ---- actions/groupblock.php | 1 - actions/groupbyid.php | 2 -- actions/grouplogo.php | 7 ------- actions/groupqueue.php | 5 ----- actions/grouprss.php | 4 ---- actions/groupunblock.php | 13 +------------ actions/imsettings.php | 4 ---- actions/joingroup.php | 11 +---------- actions/leavegroup.php | 10 +--------- actions/makeadmin.php | 8 -------- actions/microsummary.php | 1 - actions/nudge.php | 4 ---- actions/oauthappssettings.php | 1 - actions/oauthconnectionssettings.php | 3 --- actions/otp.php | 8 -------- actions/passwordsettings.php | 7 +++---- actions/peopletag.php | 1 - actions/peopletagautocomplete.php | 2 -- actions/peopletagged.php | 4 ---- actions/peopletagsbyuser.php | 4 ---- actions/peopletagsforuser.php | 3 --- actions/peopletagsubscribers.php | 4 ---- actions/peopletagsubscriptions.php | 3 --- actions/pluginenable.php | 5 ----- actions/profilecompletion.php | 4 ---- actions/profiletagbyid.php | 2 -- actions/public.php | 1 - actions/recoverpassword.php | 10 ---------- actions/redirecturl.php | 1 - actions/register.php | 4 ---- actions/removepeopletag.php | 5 ----- actions/repeat.php | 3 --- actions/replies.php | 2 -- actions/repliesrss.php | 1 - actions/revokerole.php | 4 ---- actions/rsd.php | 6 +----- actions/sandbox.php | 2 -- actions/showapplication.php | 4 ---- actions/showfavorites.php | 2 -- actions/showmessage.php | 1 - actions/shownotice.php | 2 -- actions/showprofiletag.php | 5 ----- actions/silence.php | 2 -- actions/siteadminpanel.php | 1 - actions/smssettings.php | 4 ---- actions/subedit.php | 10 +--------- actions/subqueue.php | 1 - actions/subscribe.php | 4 ---- actions/subscribepeopletag.php | 5 ----- actions/tag.php | 5 +---- actions/tagprofile.php | 2 -- actions/tagrss.php | 1 - actions/unblock.php | 2 -- actions/unsandbox.php | 2 -- actions/unsilence.php | 2 -- actions/unsubscribe.php | 9 +-------- actions/unsubscribepeopletag.php | 10 +--------- actions/urlsettings.php | 1 - actions/usergroups.php | 3 --- index.php | 3 --- lib/adminpanelaction.php | 5 ----- lib/apiaction.php | 3 --- lib/apilistusers.php | 1 - lib/galleryaction.php | 4 ---- lib/groupaction.php | 5 ----- lib/mailbox.php | 5 +---- lib/profileformaction.php | 2 -- lib/settingsaction.php | 1 - plugins/AnonymousFave/actions/anondisfavor.php | 2 -- plugins/AnonymousFave/actions/anonfavor.php | 6 +----- plugins/Bookmark/BookmarkPlugin.php | 1 - plugins/Bookmark/actions/apitimelinebookmarks.php | 2 -- plugins/Bookmark/actions/bookmarks.php | 1 - plugins/Bookmark/actions/bookmarksrss.php | 1 - plugins/CasAuthentication/actions/caslogin.php | 2 -- plugins/EmailRegistration/actions/emailregister.php | 1 - plugins/Event/actions/timelist.php | 2 -- .../actions/profiledetailsettings.php | 2 -- plugins/FacebookBridge/FacebookBridgePlugin.php | 1 - .../FacebookBridge/actions/facebookfinishlogin.php | 10 ---------- plugins/FacebookBridge/actions/facebooksettings.php | 1 - .../actions/profilefields.php | 2 -- plugins/GroupPrivateMessage/actions/groupinbox.php | 1 - .../GroupPrivateMessage/actions/newgroupmessage.php | 1 - plugins/Irc/lib/ircmanager.php | 1 - plugins/Mapstraction/actions/map.php | 3 --- plugins/Minify/actions/minify.php | 3 --- plugins/OStatus/OStatusPlugin.php | 1 - plugins/OStatus/actions/groupsalmon.php | 1 - plugins/OStatus/actions/ostatustag.php | 1 - plugins/OpenID/OpenIDPlugin.php | 3 --- plugins/OpenID/actions/finishopenidlogin.php | 10 +--------- plugins/OpenID/actions/openidserver.php | 2 -- plugins/OpenID/actions/openidtrust.php | 2 -- plugins/SearchSub/actions/searchsub.php | 4 ---- plugins/SubMirror/actions/basemirror.php | 3 --- plugins/TagSub/actions/tagsub.php | 4 ---- .../TwitterBridge/actions/twitterauthorization.php | 10 +--------- plugins/TwitterBridge/actions/twittersettings.php | 2 -- plugins/UserFlag/actions/adminprofileflag.php | 2 -- 132 files changed, 20 insertions(+), 472 deletions(-) diff --git a/actions/addpeopletag.php b/actions/addpeopletag.php index 1c0ce55a2b..b501ce0fd9 100644 --- a/actions/addpeopletag.php +++ b/actions/addpeopletag.php @@ -77,7 +77,6 @@ class AddpeopletagAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -87,7 +86,6 @@ class AddpeopletagAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } // Profile to subscribe to @@ -99,7 +97,6 @@ class AddpeopletagAction extends Action if (empty($this->tagged)) { // TRANS: Client error displayed trying to perform an action related to a non-existing profile. $this->clientError(_('No such profile.')); - return false; } $id = $this->arg('peopletag_id'); @@ -108,7 +105,6 @@ class AddpeopletagAction extends Action if (empty($this->peopletag)) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.')); - return false; } return true; @@ -144,7 +140,6 @@ class AddpeopletagAction extends Action 'The remote server is probably not responding correctly. ' . 'Please try retrying later.'), $this->profile->profileurl)); } - return false; } if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); diff --git a/actions/allrss.php b/actions/allrss.php index 637352bf4b..fee52c79ab 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -67,7 +67,6 @@ class AllrssAction extends Rss10Action if (!$this->user) { // TRANS: Client error when user not found for an rss related action. $this->clientError(_('No such user.')); - return false; } else { $this->notices = $this->getNotices($this->limit); return true; diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 425624707a..a3cbb418b6 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -84,7 +84,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction 404, $this->format ); - return; } // Note: Twitter no longer supports IM @@ -93,7 +92,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction // TRANS: Client error displayed when no valid device parameter is provided for a user's delivery device setting. $this->clientError(_( 'You must specify a parameter named ' . '\'device\' with a value of one of: sms, im, none.' )); - return; } if (empty($this->user)) { @@ -124,7 +122,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction common_log_db_error($this->user, 'UPDATE', __FILE__); // TRANS: Server error displayed when a user's delivery device cannot be updated. $this->serverError(_('Could not update user.')); - return; } $profile = $this->user->getProfile(); diff --git a/actions/apiaccountupdateprofile.php b/actions/apiaccountupdateprofile.php index 0e4a4fb376..60fed1e3c5 100644 --- a/actions/apiaccountupdateprofile.php +++ b/actions/apiaccountupdateprofile.php @@ -92,7 +92,6 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction if (empty($profile)) { // TRANS: Error message displayed when referring to a user without a profile. $this->clientError(_('User has no profile.')); - return; } $original = clone($profile); @@ -128,7 +127,6 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction common_log_db_error($profile, 'UPDATE', __FILE__); // TRANS: Server error displayed if a user profile could not be saved. $this->serverError(_('Could not save profile.')); - return; } $twitter_user = $this->twitterUserArray($profile, true); diff --git a/actions/apiaccountverifycredentials.php b/actions/apiaccountverifycredentials.php index ccb3bd7a60..6cc61cf6da 100644 --- a/actions/apiaccountverifycredentials.php +++ b/actions/apiaccountverifycredentials.php @@ -64,7 +64,6 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction if (!in_array($this->format, array('xml', 'json'))) { // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), $code = 404); - return; } $twitter_user = $this->twitterUserArray($this->auth_user->getProfile(), true); diff --git a/actions/apifriendshipsshow.php b/actions/apifriendshipsshow.php index 58e610ecdb..5810e14874 100644 --- a/actions/apifriendshipsshow.php +++ b/actions/apifriendshipsshow.php @@ -120,7 +120,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction if (!in_array($this->format, array('xml', 'json'))) { // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), 404); - return; } if (empty($this->source)) { @@ -129,7 +128,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction _('Could not determine source user.'), 404 ); - return; } if (empty($this->target)) { @@ -138,7 +136,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction _('Could not find target user.'), 404 ); - return; } $result = $this->twitterRelationshipArray($this->source, $this->target); diff --git a/actions/apimediaupload.php b/actions/apimediaupload.php index b4f8709fe2..6f8781fab5 100644 --- a/actions/apimediaupload.php +++ b/actions/apimediaupload.php @@ -63,7 +63,6 @@ class ApiMediaUploadAction extends ApiAuthAction _('This method requires a POST.'), 400, $this->format ); - return; } // Workaround for PHP returning empty $_POST and $_FILES when POST @@ -79,7 +78,6 @@ class ApiMediaUploadAction extends ApiAuthAction 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.', intval($_SERVER['CONTENT_LENGTH'])); $this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH'])); - return; } $upload = null; @@ -88,7 +86,6 @@ class ApiMediaUploadAction extends ApiAuthAction $upload = MediaFile::fromUpload('media', $this->auth_user->getProfile()); } catch (Exception $e) { $this->clientError($e->getMessage(), $e->getCode()); - return; } if (isset($upload)) { @@ -96,7 +93,6 @@ class ApiMediaUploadAction extends ApiAuthAction } else { // TRANS: Client error displayed when uploading a media file has failed. $this->clientError(_('Upload failed.')); - return; } } diff --git a/actions/apioauthaccesstoken.php b/actions/apioauthaccesstoken.php index 9379834d65..a1a70a9b9e 100644 --- a/actions/apioauthaccesstoken.php +++ b/actions/apioauthaccesstoken.php @@ -80,7 +80,6 @@ class ApiOAuthAccessTokenAction extends ApiOAuthAction common_debug(var_export($req, true)); $code = $e->getCode(); $this->clientError($e->getMessage(), empty($code) ? 401 : $code, 'text'); - return; } if (empty($atok)) { diff --git a/actions/apistatusesshow.php b/actions/apistatusesshow.php index 67d04a505c..3a60b87637 100644 --- a/actions/apistatusesshow.php +++ b/actions/apistatusesshow.php @@ -101,7 +101,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction if (!in_array($this->format, array('xml', 'json', 'atom'))) { // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), 404); - return; } switch ($_SERVER['REQUEST_METHOD']) { @@ -114,7 +113,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction default: // TRANS: Client error displayed calling an unsupported HTTP error in API status show. $this->clientError(_('HTTP method not supported.'), 405); - return; } } @@ -223,7 +221,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction if ($this->format != 'atom') { // TRANS: Client error displayed when trying to delete a notice not using the Atom format. $this->clientError(_('Can only delete using the Atom format.')); - return; } if (empty($this->auth_user) || @@ -231,7 +228,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction !$this->auth_user->hasRight(Right::DELETEOTHERSNOTICE))) { // TRANS: Client error displayed when a user has no rights to delete notices of other users. $this->clientError(_('Cannot delete this notice.'), 403); - return; } if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) { diff --git a/actions/approvegroup.php b/actions/approvegroup.php index db64e05962..2c8b354d34 100644 --- a/actions/approvegroup.php +++ b/actions/approvegroup.php @@ -57,7 +57,6 @@ class ApprovegroupAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to leave a group while not logged in. $this->clientError(_('You must be logged in to leave a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -72,7 +71,6 @@ class ApprovegroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('leavegroup', $args), 301); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -80,27 +78,23 @@ class ApprovegroupAction extends Action if (!$local) { // TRANS: Client error displayed when trying to leave a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); } else { // TRANS: Client error displayed when trying to leave a group without providing a group name or group ID. $this->clientError(_('No nickname or ID.'), 404); - return false; } if (!$this->group) { // TRANS: Client error displayed when trying to leave a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); if (empty($cur)) { // TRANS: Client error displayed trying to approve group membership while not logged in. $this->clientError(_('Must be logged in.'), 403); - return false; } if ($this->arg('profile_id')) { if ($cur->isAdmin($this->group)) { @@ -108,12 +102,10 @@ class ApprovegroupAction extends Action } else { // TRANS: Client error displayed trying to approve group membership while not a group administrator. $this->clientError(_('Only group admin can approve or cancel join requests.'), 403); - return false; } } else { // TRANS: Client error displayed trying to approve group membership without specifying a profile to approve. $this->clientError(_('Must specify a profile.')); - return false; } $this->request = Group_join_queue::pkeyGet(array('profile_id' => $this->profile->id, @@ -186,9 +178,7 @@ class ApprovegroupAction extends Action $this->elementEnd('body'); $this->endHTML(); } else { - common_redirect(common_local_url('groupmembers', array('nickname' => - $this->group->nickname)), - 303); + common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303); } } } diff --git a/actions/approvesub.php b/actions/approvesub.php index b92ad66e7a..c9fa804412 100644 --- a/actions/approvesub.php +++ b/actions/approvesub.php @@ -58,14 +58,12 @@ class ApprovesubAction extends Action if (empty($cur)) { // TRANS: Client error displayed trying to approve group membership while not logged in. $this->clientError(_('Must be logged in.'), 403); - return false; } if ($this->arg('profile_id')) { $this->profile = Profile::getKV('id', $this->arg('profile_id')); } else { // TRANS: Client error displayed trying to approve subscriptionswithout specifying a profile to approve. $this->clientError(_('Must specify a profile.')); - return false; } $this->request = Subscription_queue::pkeyGet(array('subscriber' => $this->profile->id, diff --git a/actions/atompubshowsubscription.php b/actions/atompubshowsubscription.php index ec3949c4d8..04681f3445 100644 --- a/actions/atompubshowsubscription.php +++ b/actions/atompubshowsubscription.php @@ -118,7 +118,6 @@ class AtompubshowsubscriptionAction extends ApiAuthAction default: // TRANS: Client error shown when using a non-supported HTTP method. $this->clientError(_('HTTP method not supported.'), 405); - return; } return; diff --git a/actions/atompubsubscriptionfeed.php b/actions/atompubsubscriptionfeed.php index 1b9f4b98a5..5c7184e5c1 100644 --- a/actions/atompubsubscriptionfeed.php +++ b/actions/atompubsubscriptionfeed.php @@ -105,7 +105,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction default: // TRANS: Client exception thrown when using an unsupported HTTP method. $this->clientError(_('HTTP method not supported.'), 405); - return; } return; @@ -232,7 +231,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $dom->documentElement->localName != 'entry') { // TRANS: Client error displayed when not using an Atom entry. $this->clientError(_('Atom post must be an Atom entry.')); - return; } $activity = new Activity($dom->documentElement); @@ -244,7 +242,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction if ($activity->verb != ActivityVerb::FOLLOW) { // TRANS: Client error displayed when not using the follow verb. $this->clientError(_('Can only handle Follow activities.')); - return; } $person = $activity->objects[0]; @@ -252,7 +249,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction if ($person->type != ActivityObject::PERSON) { // TRANS: Client exception thrown when subscribing to an object that is not a person. $this->clientError(_('Can only follow people.')); - return; } // XXX: OStatus discovery (maybe) @@ -263,7 +259,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction // TRANS: Client exception thrown when subscribing to a non-existing profile. // TRANS: %s is the unknown profile ID. $this->clientError(sprintf(_('Unknown profile %s.'), $person->id)); - return; } if (Subscription::exists($this->_profile, $profile)) { @@ -273,7 +268,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $this->clientError(sprintf(_('Already subscribed to %s.'), $person->id), 409); - return; } if (Subscription::start($this->_profile, $profile)) { diff --git a/actions/attachment.php b/actions/attachment.php index 321525a55f..56ecceb860 100644 --- a/actions/attachment.php +++ b/actions/attachment.php @@ -71,7 +71,6 @@ class AttachmentAction extends Action if (empty($this->attachment)) { // TRANS: Client error displayed trying to get a non-existing attachment. $this->clientError(_('No such attachment.'), 404); - return false; } return true; } diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index dd8093b765..d3d5b31002 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -106,7 +106,6 @@ class AvatarsettingsAction extends SettingsAction common_log_db_error($user, 'SELECT', __FILE__); // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return; } $this->elementStart('form', array('enctype' => 'multipart/form-data', @@ -195,7 +194,6 @@ class AvatarsettingsAction extends SettingsAction common_log_db_error($user, 'SELECT', __FILE__); // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return; } $this->elementStart('form', array('method' => 'post', @@ -362,7 +360,6 @@ class AvatarsettingsAction extends SettingsAction if (!$filedata) { // TRANS: Server error displayed if an avatar upload went wrong somehow server side. $this->serverError(_('Lost our file data.')); - return; } $file_d = ($filedata['width'] > $filedata['height']) diff --git a/actions/block.php b/actions/block.php index f195fb5a88..7458caa6ac 100644 --- a/actions/block.php +++ b/actions/block.php @@ -66,7 +66,6 @@ class BlockAction extends ProfileFormAction if ($cur->hasBlocked($this->profile)) { // TRANS: Client error displayed when blocking a user that has already been blocked. $this->clientError(_('You already blocked that user.')); - return false; } return true; @@ -187,7 +186,6 @@ class BlockAction extends ProfileFormAction if (!$result) { // TRANS: Server error displayed when blocking a user fails. $this->serverError(_('Failed to save block information.')); - return; } } diff --git a/actions/blockedfromgroup.php b/actions/blockedfromgroup.php index a00c12ef58..a2e7c5767f 100644 --- a/actions/blockedfromgroup.php +++ b/actions/blockedfromgroup.php @@ -65,13 +65,11 @@ class BlockedfromgroupAction extends GroupAction $args['page'] = $this->page; } common_redirect(common_local_url('blockedfromgroup', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed when requesting a list of blocked users for a group without providing a group nickname. $this->clientError(_('No nickname.'), 404); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -79,7 +77,6 @@ class BlockedfromgroupAction extends GroupAction if (!$local) { // TRANS: Client error displayed when requesting a list of blocked users for a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); @@ -87,7 +84,6 @@ class BlockedfromgroupAction extends GroupAction if (!$this->group) { // TRANS: Client error displayed when requesting a list of blocked users for a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } return true; diff --git a/actions/cancelgroup.php b/actions/cancelgroup.php index 4196eb3ffc..93f630e060 100644 --- a/actions/cancelgroup.php +++ b/actions/cancelgroup.php @@ -57,7 +57,6 @@ class CancelgroupAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to leave a group while not logged in. $this->clientError(_('You must be logged in to leave a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -71,7 +70,6 @@ class CancelgroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('leavegroup', $args), 301); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -79,27 +77,23 @@ class CancelgroupAction extends Action if (!$local) { // TRANS: Client error displayed when trying to leave a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); } else { // TRANS: Client error displayed when trying to leave a group without providing a group name or group ID. $this->clientError(_('No nickname or ID.'), 404); - return false; } if (!$this->group) { // TRANS: Client error displayed when trying to leave a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); if (empty($cur)) { // TRANS: Client error displayed when trying to leave a group while not logged in. $this->clientError(_('Must be logged in.'), 403); - return false; } if ($this->arg('profile_id')) { if ($cur->isAdmin($this->group)) { @@ -108,7 +102,6 @@ class CancelgroupAction extends Action // TRANS: Client error displayed when trying to approve or cancel a group join request without // TRANS: being a group administrator. $this->clientError(_('Only group admin can approve or cancel join requests.'), 403); - return false; } } else { $this->profile = $cur->getProfile(); @@ -164,9 +157,7 @@ class CancelgroupAction extends Action $this->elementEnd('body'); $this->endHTML(); } else { - common_redirect(common_local_url('groupmembers', array('nickname' => - $this->group->nickname)), - 303); + common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303); } } } diff --git a/actions/cancelsubscription.php b/actions/cancelsubscription.php index 590fde9f2e..3c3e84df3f 100644 --- a/actions/cancelsubscription.php +++ b/actions/cancelsubscription.php @@ -55,7 +55,6 @@ class CancelsubscriptionAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return; } $user = common_current_user(); @@ -63,7 +62,6 @@ class CancelsubscriptionAction extends Action if ($_SERVER['REQUEST_METHOD'] != 'POST') { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); - return; } /* Use a session token for CSRF protection. */ @@ -74,7 +72,6 @@ class CancelsubscriptionAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. ' . 'Try again, please.')); - return; } $other_id = $this->arg('unsubscribeto'); @@ -82,7 +79,6 @@ class CancelsubscriptionAction extends Action if (!$other_id) { // TRANS: Client error displayed when trying to leave a group without specifying an ID. $this->clientError(_('No profile ID in request.')); - return; } $other = Profile::getKV('id', $other_id); @@ -90,7 +86,6 @@ class CancelsubscriptionAction extends Action if (!$other) { // TRANS: Client error displayed when trying to leave a non-existing group. $this->clientError(_('No profile with that ID.')); - return; } $this->request = Subscription_queue::pkeyGet(array('subscriber' => $user->id, diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 4aae0675a2..05ddce75a9 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -66,25 +66,21 @@ class ConfirmaddressAction extends Action if (!common_logged_in()) { common_set_returnto($this->selfUrl()); common_redirect(common_local_url('login')); - return; } $code = $this->trimmed('code'); if (!$code) { // TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action. $this->clientError(_('No confirmation code.')); - return; } $confirm = Confirm_address::getKV('code', $code); if (!$confirm) { // TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action. $this->clientError(_('Confirmation code not found.')); - return; } $cur = common_current_user(); if ($cur->id != $confirm->user_id) { // TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action. $this->clientError(_('That confirmation code is not for you!')); - return; } $type = $confirm->address_type; $transports = array(); @@ -92,7 +88,6 @@ class ConfirmaddressAction extends Action if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($transports))) { // TRANS: Server error for an unknown address type, which can be 'email', 'sms', or the name of an IM network (such as 'xmpp' or 'aim') $this->serverError(sprintf(_('Unrecognized address type %s'), $type)); - return; } $this->address = $confirm->address; $cur->query('BEGIN'); @@ -101,7 +96,6 @@ class ConfirmaddressAction extends Action if ($cur->$type == $confirm->address) { // TRANS: Client error for an already confirmed email/jabber/sms address. $this->clientError(_('That address has already been confirmed.')); - return; } $orig_user = clone($cur); @@ -120,7 +114,6 @@ class ConfirmaddressAction extends Action common_log_db_error($cur, 'UPDATE', __FILE__); // TRANS: Server error displayed when confirming an e-mail address or IM address fails. $this->serverError(_('Could not update user.')); - return; } if ($type == 'email') { @@ -136,7 +129,6 @@ class ConfirmaddressAction extends Action if($user_im_prefs->screenname == $confirm->address){ // TRANS: Client error for an already confirmed IM address. $this->clientError(_('That address has already been confirmed.')); - return; } $user_im_prefs->screenname = $confirm->address; $result = $user_im_prefs->update(); @@ -145,7 +137,6 @@ class ConfirmaddressAction extends Action common_log_db_error($user_im_prefs, 'UPDATE', __FILE__); // TRANS: Server error displayed when updating IM preferences fails. $this->serverError(_('Could not update user IM preferences.')); - return; } }else{ $user_im_prefs = new User_im_prefs(); @@ -158,7 +149,6 @@ class ConfirmaddressAction extends Action common_log_db_error($user_im_prefs, 'INSERT', __FILE__); // TRANS: Server error displayed when adding IM preferences fails. $this->serverError(_('Could not insert user IM preferences.')); - return; } } @@ -171,7 +161,6 @@ class ConfirmaddressAction extends Action // TRANS: Server error displayed when an address confirmation code deletion from the // TRANS: database fails in the contact address confirmation action. $this->serverError(_('Could not delete address confirmation.')); - return; } $cur->query('COMMIT'); diff --git a/actions/deleteapplication.php b/actions/deleteapplication.php index 763d58c762..5d7441098c 100644 --- a/actions/deleteapplication.php +++ b/actions/deleteapplication.php @@ -60,7 +60,6 @@ class DeleteapplicationAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed trying to delete an application while not logged in. $this->clientError(_('You must be logged in to delete an application.')); - return false; } $id = (int)$this->arg('id'); @@ -69,7 +68,6 @@ class DeleteapplicationAction extends Action if (empty($this->app)) { // TRANS: Client error displayed trying to delete an application that does not exist. $this->clientError(_('Application not found.')); - return false; } $cur = common_current_user(); @@ -77,7 +75,6 @@ class DeleteapplicationAction extends Action if ($cur->id != $this->app->owner) { // TRANS: Client error displayed trying to delete an application the current user does not own. $this->clientError(_('You are not the owner of this application.'), 401); - return false; } return true; @@ -101,7 +98,6 @@ class DeleteapplicationAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.')); - return; } if ($this->arg('no')) { diff --git a/actions/deletegroup.php b/actions/deletegroup.php index 5efb5e6a91..6d9d66d30e 100644 --- a/actions/deletegroup.php +++ b/actions/deletegroup.php @@ -62,7 +62,6 @@ class DeletegroupAction extends RedirectingAction if (!common_logged_in()) { // TRANS: Client error when trying to delete group while not logged in. $this->clientError(_('You must be logged in to delete a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -77,7 +76,6 @@ class DeletegroupAction extends RedirectingAction if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('leavegroup', $args), 301); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -85,27 +83,23 @@ class DeletegroupAction extends RedirectingAction if (!$local) { // TRANS: Client error when trying to delete a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); } else { // TRANS: Client error when trying to delete a group without providing a nickname or ID for the group. $this->clientError(_('No nickname or ID.'), 404); - return false; } if (!$this->group) { // TRANS: Client error when trying to delete a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); if (!$cur->hasRight(Right::DELETEGROUP)) { // TRANS: Client error when trying to delete a group without having the rights to delete it. $this->clientError(_('You are not allowed to delete this group.'), 403); - return false; } return true; @@ -166,8 +160,7 @@ class DeletegroupAction extends RedirectingAction } else { // @fixme if we could direct to the page on which this group // would have shown... that would be awesome - common_redirect(common_local_url('groups'), - 303); + common_redirect(common_local_url('groups'), 303); } } diff --git a/actions/deleteuser.php b/actions/deleteuser.php index 9f13468dc4..48ad9272e0 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -64,7 +64,6 @@ class DeleteuserAction extends ProfileFormAction if (!$cur->hasRight(Right::DELETEUSER)) { // TRANS: Client error displayed when trying to delete a user without having the right to delete users. $this->clientError(_('You cannot delete users.')); - return false; } $this->user = User::getKV('id', $this->profile->id); @@ -72,7 +71,6 @@ class DeleteuserAction extends ProfileFormAction if (empty($this->user)) { // TRANS: Client error displayed when trying to delete a non-local user. $this->clientError(_('You can only delete local users.')); - return false; } return true; diff --git a/actions/editapplication.php b/actions/editapplication.php index 00ed397193..c7e5f9052c 100644 --- a/actions/editapplication.php +++ b/actions/editapplication.php @@ -64,7 +64,6 @@ class EditApplicationAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed trying to edit an application while not logged in. $this->clientError(_('You must be logged in to edit an application.')); - return false; } $id = (int)$this->arg('id'); @@ -81,7 +80,6 @@ class EditApplicationAction extends Action if (!$this->app) { // TRANS: Client error displayed trying to edit an application that does not exist. $this->clientError(_('No such application.')); - return false; } return true; @@ -130,7 +128,6 @@ class EditApplicationAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.')); - return; } $cur = common_current_user(); diff --git a/actions/editgroup.php b/actions/editgroup.php index befbd55992..7b499d00ff 100644 --- a/actions/editgroup.php +++ b/actions/editgroup.php @@ -66,7 +66,6 @@ class EditgroupAction extends GroupAction if (!common_logged_in()) { // TRANS: Client error displayed trying to edit a group while not logged in. $this->clientError(_('You must be logged in to create a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -77,13 +76,11 @@ class EditgroupAction extends GroupAction if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('editgroup', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed trying to edit a group while not proving a nickname for the group to edit. $this->clientError(_('No nickname.'), 404); - return false; } $groupid = $this->trimmed('groupid'); @@ -100,7 +97,6 @@ class EditgroupAction extends GroupAction if (!$this->group) { // TRANS: Client error displayed trying to edit a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); @@ -108,7 +104,6 @@ class EditgroupAction extends GroupAction if (!$cur->isAdmin($this->group)) { // TRANS: Client error displayed trying to edit a group while not being a group admin. $this->clientError(_('You must be an admin to edit the group.'), 403); - return false; } return true; @@ -274,9 +269,7 @@ class EditgroupAction extends GroupAction } if ($this->group->nickname != $orig->nickname) { - common_redirect(common_local_url('editgroup', - array('nickname' => $nickname)), - 303); + common_redirect(common_local_url('editgroup', array('nickname' => $nickname)), 303); } else { // TRANS: Group edit form success message. $this->showForm(_('Options saved.')); diff --git a/actions/editpeopletag.php b/actions/editpeopletag.php index 72dcc0df72..c812255c70 100644 --- a/actions/editpeopletag.php +++ b/actions/editpeopletag.php @@ -67,7 +67,6 @@ class EditpeopletagAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $id = $this->arg('id'); @@ -88,7 +87,6 @@ class EditpeopletagAction extends Action if ($tagger_arg != $tagger || $tag_arg != $tag) { $args = array('tagger' => $tagger, 'tag' => $tag); common_redirect(common_local_url('editpeopletag', $args), 301); - return false; } $user = null; @@ -101,7 +99,6 @@ class EditpeopletagAction extends Action if (!$tagger) { // TRANS: Error message displayed when trying to perform an action that requires a tagging user or ID. $this->clientError(_('No tagger or ID.'), 404); - return false; } $user = User::getKV('nickname', $tagger); @@ -111,20 +108,17 @@ class EditpeopletagAction extends Action if (!$this->peopletag) { // TRANS: Client error displayed when referring to a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } if (!$user) { // This should not be happening // TRANS: Client error displayed when referring to non-local user. $this->clientError(_('Not a local user.'), 404); - return false; } if ($current->id != $user->id) { // TRANS: Client error displayed when reting to edit a tag that was not self-created. $this->clientError(_('You must be the creator of the tag to edit it.'), 404); - return false; } $this->tagger = $user->getProfile(); @@ -311,9 +305,7 @@ class EditpeopletagAction extends Action // This might take quite a bit of time. $this->peopletag->delete(); // send home. - common_redirect(common_local_url('all', - array('nickname' => $this->tagger->nickname)), - 303); + common_redirect(common_local_url('all', array('nickname' => $this->tagger->nickname)), 303); } if ($tag != $orig->tag) { diff --git a/actions/emailsettings.php b/actions/emailsettings.php index f12aecd57d..ad16d4da4b 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -351,7 +351,6 @@ class EmailsettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating e-mail preferences. $this->serverError(_('Could not update user.')); - return; } $user->query('COMMIT'); @@ -419,7 +418,6 @@ class EmailsettingsAction extends SettingsAction common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding e-mail confirmation code. $this->serverError(_('Could not insert confirmation code.')); - return; } mail_confirm_address($user, $confirm->code, $user->nickname, $email); @@ -463,7 +461,6 @@ class EmailsettingsAction extends SettingsAction common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling e-mail address confirmation. $this->serverError(_('Could not delete email confirmation.')); - return; } // TRANS: Message given after successfully canceling e-mail address confirmation. @@ -502,7 +499,6 @@ class EmailsettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered e-mail address. $this->serverError(_('Could not update user.')); - return; } $user->query('COMMIT'); diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index 8b5ea548be..de901b0b46 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -70,7 +70,6 @@ class FavoritesrssAction extends Rss10Action if (!$this->user) { // TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist. $this->clientError(_('No such user.')); - return false; } else { $this->notices = $this->getNotices($this->limit); return true; diff --git a/actions/foaf.php b/actions/foaf.php index e0662aa2fa..83f7d97d58 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -40,7 +40,6 @@ class FoafAction extends Action if (empty($nickname_arg)) { // TRANS: Client error displayed when requesting Friends of a Friend feed without providing a user nickname. $this->clientError(_('No such user.'), 404); - return false; } $this->nickname = common_canonical_nickname($nickname_arg); @@ -51,7 +50,6 @@ class FoafAction extends Action common_redirect(common_local_url('foaf', array('nickname' => $this->nickname)), 301); - return false; } $this->user = User::getKV('nickname', $this->nickname); @@ -59,7 +57,6 @@ class FoafAction extends Action if (!$this->user) { // TRANS: Client error displayed when requesting Friends of a Friend feed for an object that is not a user. $this->clientError(_('No such user.'), 404); - return false; } $this->profile = $this->user->getProfile(); @@ -67,7 +64,6 @@ class FoafAction extends Action if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.'), 500); - return false; } return true; diff --git a/actions/foafgroup.php b/actions/foafgroup.php index 34332c7e29..f9c61ac5dc 100644 --- a/actions/foafgroup.php +++ b/actions/foafgroup.php @@ -44,7 +44,6 @@ class FoafGroupAction extends Action if (empty($nickname_arg)) { // TRANS: Client error displayed when requesting Friends of a Friend feed without providing a group nickname. $this->clientError(_('No such group.'), 404); - return false; } $this->nickname = common_canonical_nickname($nickname_arg); @@ -63,7 +62,6 @@ class FoafGroupAction extends Action if (!$local) { // TRANS: Client error displayed when requesting Friends of a Friend feed for a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); @@ -71,7 +69,6 @@ class FoafGroupAction extends Action if (!$this->group) { // TRANS: Client error displayed when requesting Friends of a Friend feed for a nickname that is not a group. $this->clientError(_('No such group.'), 404); - return false; } common_set_returnto($this->selfUrl()); diff --git a/actions/getfile.php b/actions/getfile.php index 99ff84bcef..f0c98f7416 100644 --- a/actions/getfile.php +++ b/actions/getfile.php @@ -71,12 +71,10 @@ class GetfileAction extends Action if (empty($path) or !file_exists($path)) { // TRANS: Client error displayed when requesting a non-existent file. $this->clientError(_('No such file.'), 404); - return false; } if (!is_readable($path)) { // TRANS: Client error displayed when requesting a file without having read access to it. $this->clientError(_('Cannot read file.'), 403); - return false; } $this->path = $path; diff --git a/actions/grantrole.php b/actions/grantrole.php index 36369a8600..35f0dcf961 100644 --- a/actions/grantrole.php +++ b/actions/grantrole.php @@ -59,12 +59,10 @@ class GrantRoleAction extends ProfileFormAction if (!Profile_role::isValid($this->role)) { // TRANS: Client error displayed when trying to assign an invalid role to a user. $this->clientError(_('Invalid role.')); - return false; } if (!Profile_role::isSettable($this->role)) { // TRANS: Client error displayed when trying to assign an reserved role to a user. $this->clientError(_('This role is reserved and cannot be set.')); - return false; } $cur = common_current_user(); @@ -74,7 +72,6 @@ class GrantRoleAction extends ProfileFormAction if (!$cur->hasRight(Right::GRANTROLE)) { // TRANS: Client error displayed when trying to assign a role to a user while not being allowed to set roles. $this->clientError(_('You cannot grant user roles on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -82,7 +79,6 @@ class GrantRoleAction extends ProfileFormAction if ($this->profile->hasRole($this->role)) { // TRANS: Client error displayed when trying to assign a role to a user that already has that role. $this->clientError(_('User already has this role.')); - return false; } return true; diff --git a/actions/groupblock.php b/actions/groupblock.php index 1c6ccb9e59..d65b62bdff 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -205,7 +205,6 @@ class GroupblockAction extends RedirectingAction if (empty($block)) { // TRANS: Server error displayed when trying to block a user from a group fails because of an application error. $this->serverError(_("Database error blocking user from group.")); - return false; } $this->returnToPrevious(); diff --git a/actions/groupbyid.php b/actions/groupbyid.php index 5baaab5e6d..b82a861e97 100644 --- a/actions/groupbyid.php +++ b/actions/groupbyid.php @@ -71,7 +71,6 @@ class GroupbyidAction extends Action if (!$id) { // TRANS: Client error displayed referring to a group's permalink without providing a group ID. $this->clientError(_('No ID.')); - return false; } common_debug("Got ID $id"); @@ -81,7 +80,6 @@ class GroupbyidAction extends Action if (!$this->group) { // TRANS: Client error displayed referring to a group's permalink for a non-existing group ID. $this->clientError(_('No such group.'), 404); - return false; } return true; diff --git a/actions/grouplogo.php b/actions/grouplogo.php index adffe63c38..10fd33088d 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -67,7 +67,6 @@ class GrouplogoAction extends GroupAction if (!common_logged_in()) { // TRANS: Client error displayed when trying to create a group while not logged in. $this->clientError(_('You must be logged in to create a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -78,13 +77,11 @@ class GrouplogoAction extends GroupAction if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('grouplogo', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed when trying to change group logo settings without providing a nickname. $this->clientError(_('No nickname.'), 404); - return false; } $groupid = $this->trimmed('groupid'); @@ -101,7 +98,6 @@ class GrouplogoAction extends GroupAction if (!$this->group) { // TRANS: Client error displayed when trying to update logo settings for a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); @@ -109,7 +105,6 @@ class GrouplogoAction extends GroupAction if (!$cur->isAdmin($this->group)) { // TRANS: Client error displayed when trying to change group logo settings while not being a group admin. $this->clientError(_('You must be an admin to edit the group.'), 403); - return false; } return true; @@ -182,7 +177,6 @@ class GrouplogoAction extends GroupAction common_log_db_error($user, 'SELECT', __FILE__); // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return; } $original = $this->group->original_logo; @@ -389,7 +383,6 @@ class GrouplogoAction extends GroupAction if (!$filedata) { // TRANS: Server error displayed trying to crop an uploaded group logo that is no longer present. $this->serverError(_('Lost our file data.')); - return; } // If image is not being cropped assume pos & dimentions of original diff --git a/actions/groupqueue.php b/actions/groupqueue.php index 7227b11090..c50eff36f8 100644 --- a/actions/groupqueue.php +++ b/actions/groupqueue.php @@ -69,13 +69,11 @@ class GroupqueueAction extends GroupAction $args['page'] = $this->page; } common_redirect(common_local_url('groupqueue', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed when trying to view group members without providing a group nickname. $this->clientError(_('No nickname.'), 404); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -83,7 +81,6 @@ class GroupqueueAction extends GroupAction if (!$local) { // TRANS: Client error displayed when trying to view group members for a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); @@ -91,14 +88,12 @@ class GroupqueueAction extends GroupAction if (!$this->group) { // TRANS: Client error displayed when trying to view group members for an object that is not a group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); if (!$cur || !$cur->isAdmin($this->group)) { // TRANS: Client error displayed when trying to approve group applicants without being a group administrator. $this->clientError(_('Only the group admin may approve users.')); - return false; } return true; } diff --git a/actions/grouprss.php b/actions/grouprss.php index 4728f429f4..87e34d73f8 100644 --- a/actions/grouprss.php +++ b/actions/grouprss.php @@ -81,13 +81,11 @@ class groupRssAction extends Rss10Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('showgroup', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname. $this->clientError(_('No nickname.'), 404); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -95,7 +93,6 @@ class groupRssAction extends Rss10Action if (!$local) { // TRANS: Client error displayed when requesting a group RSS feed for group that does not exist. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); @@ -103,7 +100,6 @@ class groupRssAction extends Rss10Action if (!$this->group) { // TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group. $this->clientError(_('No such group.'), 404); - return false; } $this->notices = $this->getNotices($this->limit); diff --git a/actions/groupunblock.php b/actions/groupunblock.php index 6f26108155..a24177f64c 100644 --- a/actions/groupunblock.php +++ b/actions/groupunblock.php @@ -58,48 +58,40 @@ class GroupunblockAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $token = $this->trimmed('token'); if (empty($token) || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. Try again, please.')); - return; } $id = $this->trimmed('unblockto'); if (empty($id)) { // TRANS: Client error displayed when trying to unblock a user from a group without providing a profile. $this->clientError(_('No profile specified.')); - return false; } $this->profile = Profile::getKV('id', $id); if (empty($this->profile)) { // TRANS: Client error displayed when trying to unblock a user from a group without providing an existing profile. $this->clientError(_('No profile with that ID.')); - return false; } $group_id = $this->trimmed('unblockgroup'); if (empty($group_id)) { // TRANS: Client error displayed when trying to unblock a user from a group without providing a group. $this->clientError(_('No group specified.')); - return false; } $this->group = User_group::getKV('id', $group_id); if (empty($this->group)) { // TRANS: Client error displayed when trying to unblock a user from a non-existing group. $this->clientError(_('No such group.')); - return false; } $user = common_current_user(); if (!$user->isAdmin($this->group)) { // TRANS: Client error displayed when trying to unblock a user from a group without being an administrator for the group. $this->clientError(_('Only an admin can unblock group members.'), 401); - return false; } if (!Group_block::isBlocked($this->group, $this->profile)) { // TRANS: Client error displayed when trying to unblock a non-blocked user from a group. $this->clientError(_('User is not blocked from group.')); - return false; } return true; } @@ -131,7 +123,6 @@ class GroupunblockAction extends Action if (!$result) { // TRANS: Server error displayed when unblocking a user from a group fails because of an unknown error. $this->serverError(_('Error removing the block.')); - return; } foreach ($this->args as $k => $v) { @@ -145,9 +136,7 @@ class GroupunblockAction extends Action if ($action) { common_redirect(common_local_url($action, $args), 303); } else { - common_redirect(common_local_url('blockedfromgroup', - array('nickname' => $this->group->nickname)), - 303); + common_redirect(common_local_url('blockedfromgroup', array('nickname' => $this->group->nickname)), 303); } } } diff --git a/actions/imsettings.php b/actions/imsettings.php index 809dbd2879..92fff45a7d 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -292,7 +292,6 @@ class ImsettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating IM preferences. $this->serverError(_('Could not update IM preferences.')); - return; } }while($user_im_prefs->fetch()); } @@ -364,7 +363,6 @@ class ImsettingsAction extends SettingsAction common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding Instant Messaging confirmation code. $this->serverError(_('Could not insert confirmation code.')); - return; } Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user)); @@ -407,7 +405,6 @@ class ImsettingsAction extends SettingsAction common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling IM address confirmation. $this->serverError(_('Could not delete confirmation.')); - return; } // TRANS: Message given after successfully canceling IM address confirmation. @@ -445,7 +442,6 @@ class ImsettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered IM address. $this->serverError(_('Could not update user IM preferences.')); - return; } // XXX: unsubscribe to the old address diff --git a/actions/joingroup.php b/actions/joingroup.php index af204698d8..c533ebdedb 100644 --- a/actions/joingroup.php +++ b/actions/joingroup.php @@ -57,7 +57,6 @@ class JoingroupAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to join a group while not logged in. $this->clientError(_('You must be logged in to join a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -72,7 +71,6 @@ class JoingroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('leavegroup', $args), 301); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -80,20 +78,17 @@ class JoingroupAction extends Action if (!$local) { // TRANS: Client error displayed when trying to join a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); } else { // TRANS: Client error displayed when trying to join a group without providing a group name or group ID. $this->clientError(_('No nickname or ID.'), 404); - return false; } if (!$this->group) { // TRANS: Client error displayed when trying to join a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); @@ -101,13 +96,11 @@ class JoingroupAction extends Action if ($cur->isMember($this->group)) { // TRANS: Client error displayed when trying to join a group while already a member. $this->clientError(_('You are already a member of that group.'), 403); - return false; } if (Group_block::isBlocked($this->group, $cur->getProfile())) { // TRANS: Client error displayed when trying to join a group while being blocked form joining it. $this->clientError(_('You have been blocked from that group by the admin.'), 403); - return false; } return true; @@ -165,9 +158,7 @@ class JoingroupAction extends Action $this->elementEnd('body'); $this->endHTML(); } else { - common_redirect(common_local_url('groupmembers', array('nickname' => - $this->group->nickname)), - 303); + common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303); } } } diff --git a/actions/leavegroup.php b/actions/leavegroup.php index d92dd37de5..e0e2c27890 100644 --- a/actions/leavegroup.php +++ b/actions/leavegroup.php @@ -57,7 +57,6 @@ class LeavegroupAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to leave a group while not logged in. $this->clientError(_('You must be logged in to leave a group.')); - return false; } $nickname_arg = $this->trimmed('nickname'); @@ -72,7 +71,6 @@ class LeavegroupAction extends Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('leavegroup', $args), 301); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -80,20 +78,17 @@ class LeavegroupAction extends Action if (!$local) { // TRANS: Client error displayed when trying to leave a non-local group. $this->clientError(_('No such group.'), 404); - return false; } $this->group = User_group::getKV('id', $local->group_id); } else { // TRANS: Client error displayed when trying to leave a group without providing a group name or group ID. $this->clientError(_('No nickname or ID.'), 404); - return false; } if (!$this->group) { // TRANS: Client error displayed when trying to leave a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); @@ -101,7 +96,6 @@ class LeavegroupAction extends Action if (!$cur->isMember($this->group)) { // TRANS: Client error displayed when trying to join a group while already a member. $this->clientError(_('You are not a member of that group.'), 403); - return false; } return true; @@ -147,9 +141,7 @@ class LeavegroupAction extends Action $this->elementEnd('body'); $this->endHTML(); } else { - common_redirect(common_local_url('groupmembers', array('nickname' => - $this->group->nickname)), - 303); + common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303); } } } diff --git a/actions/makeadmin.php b/actions/makeadmin.php index 5cc27032ef..05912e150c 100644 --- a/actions/makeadmin.php +++ b/actions/makeadmin.php @@ -60,44 +60,37 @@ class MakeadminAction extends RedirectingAction if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $token = $this->trimmed('token'); if (empty($token) || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. Try again, please.')); - return; } $id = $this->trimmed('profileid'); if (empty($id)) { // TRANS: Client error displayed when not providing a profile ID on the Make Admin page. $this->clientError(_('No profile specified.')); - return false; } $this->profile = Profile::getKV('id', $id); if (empty($this->profile)) { // TRANS: Client error displayed when specifying an invalid profile ID on the Make Admin page. $this->clientError(_('No profile with that ID.')); - return false; } $group_id = $this->trimmed('groupid'); if (empty($group_id)) { // TRANS: Client error displayed when not providing a group ID on the Make Admin page. $this->clientError(_('No group specified.')); - return false; } $this->group = User_group::getKV('id', $group_id); if (empty($this->group)) { // TRANS: Client error displayed when providing an invalid group ID on the Make Admin page. $this->clientError(_('No such group.')); - return false; } $user = common_current_user(); if (!$user->isAdmin($this->group) && !$user->hasRight(Right::MAKEGROUPADMIN)) { // TRANS: Client error displayed when trying to make another user admin on the Make Admin page while not an admin. $this->clientError(_('Only an admin can make another user an admin.'), 401); - return false; } if ($this->profile->isAdmin($this->group)) { // TRANS: Client error displayed when trying to make another user admin on the Make Admin page who already is admin. @@ -106,7 +99,6 @@ class MakeadminAction extends RedirectingAction $this->profile->getBestName(), $this->group->getBestName()), 401); - return false; } return true; } diff --git a/actions/microsummary.php b/actions/microsummary.php index 14c626ac51..2742eb9a04 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -61,7 +61,6 @@ class MicrosummaryAction extends Action if (!$user) { // TRANS: Client error displayed trying to make a micro summary without providing a valid user. $this->clientError(_('No such user.'), 404); - return; } $notice = $user->getCurrentNotice(); diff --git a/actions/nudge.php b/actions/nudge.php index 0ca3753dc7..801d1f0681 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -62,7 +62,6 @@ class NudgeAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return; } $user = common_current_user(); @@ -71,7 +70,6 @@ class NudgeAction extends Action if ($_SERVER['REQUEST_METHOD'] != 'POST') { common_redirect(common_local_url('showstream', array('nickname' => $other->nickname))); - return; } // CSRF protection @@ -80,13 +78,11 @@ class NudgeAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. Try again, please.')); - return; } if (!$other->email || !$other->emailnotifynudge) { // TRANS: Client error displayed trying to nudge a user that cannot be nudged. $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email address yet.')); - return; } $this->notify($user, $other); diff --git a/actions/oauthappssettings.php b/actions/oauthappssettings.php index d6477f6be9..29e6d56073 100644 --- a/actions/oauthappssettings.php +++ b/actions/oauthappssettings.php @@ -57,7 +57,6 @@ class OauthappssettingsAction extends SettingsAction if (!common_logged_in()) { // TRANS: Message displayed to an anonymous user trying to view OAuth application list. $this->clientError(_('You must be logged in to list your applications.')); - return false; } return true; diff --git a/actions/oauthconnectionssettings.php b/actions/oauthconnectionssettings.php index eaa0fae8da..9aa3ad434f 100644 --- a/actions/oauthconnectionssettings.php +++ b/actions/oauthconnectionssettings.php @@ -142,7 +142,6 @@ class OauthconnectionssettingsAction extends SettingsAction } else { // TRANS: Client error when submitting a form with unexpected information. $this->clientError(_('Unexpected form submission.'), 401); - return false; } } @@ -163,7 +162,6 @@ class OauthconnectionssettingsAction extends SettingsAction if (empty($appUser)) { // TRANS: Client error when trying to revoke access for an application while not being a user of it. $this->clientError(_('You are not a user of that application.'), 401); - return false; } $app = Oauth_application::getKV('id', $appUser->application_id); @@ -178,7 +176,6 @@ class OauthconnectionssettingsAction extends SettingsAction // TRANS: Client error when revoking access has failed for some reason. // TRANS: %s is the application ID revoking access failed for. $this->clientError(sprintf(_('Unable to revoke access for application: %s.'), $app->id)); - return false; } $msg = 'API OAuth - user %s (id: %d) revoked access token %s for app id %d'; diff --git a/actions/otp.php b/actions/otp.php index f14bba9a2b..c44f3673ae 100644 --- a/actions/otp.php +++ b/actions/otp.php @@ -60,7 +60,6 @@ class OtpAction extends Action if (common_is_real_login()) { // TRANS: Client error displayed trying to use "one time password login" when already logged in. $this->clientError(_('Already logged in.')); - return false; } $id = $this->trimmed('user_id'); @@ -68,7 +67,6 @@ class OtpAction extends Action if (empty($id)) { // TRANS: Client error displayed trying to use "one time password login" without specifying a user. $this->clientError(_('No user ID specified.')); - return false; } $this->user = User::getKV('id', $id); @@ -76,7 +74,6 @@ class OtpAction extends Action if (empty($this->user)) { // TRANS: Client error displayed trying to use "one time password login" without using an existing user. $this->clientError(_('No such user.')); - return false; } $this->token = $this->trimmed('token'); @@ -84,7 +81,6 @@ class OtpAction extends Action if (empty($this->token)) { // TRANS: Client error displayed trying to use "one time password login" without specifying a login token. $this->clientError(_('No login token specified.')); - return false; } $this->lt = Login_token::getKV('user_id', $id); @@ -92,13 +88,11 @@ class OtpAction extends Action if (empty($this->lt)) { // TRANS: Client error displayed trying to use "one time password login" without requesting a login token. $this->clientError(_('No login token requested.')); - return false; } if ($this->lt->token != $this->token) { // TRANS: Client error displayed trying to use "one time password login" while specifying an invalid login token. $this->clientError(_('Invalid login token specified.')); - return false; } if ($this->lt->modified > time() + Login_token::TIMEOUT) { @@ -108,7 +102,6 @@ class OtpAction extends Action $this->lt = null; // TRANS: Client error displayed trying to use "one time password login" while specifying an expired login token. $this->clientError(_('Login token expired.')); - return false; } $this->rememberme = $this->boolean('rememberme'); @@ -125,7 +118,6 @@ class OtpAction extends Action if (!common_set_user($this->user)) { // TRANS: Server error displayed when a user object could not be created trying to login using "one time password login". $this->serverError(_('Error setting user. You are probably not authorized.')); - return; } // We're now logged in; disable the lt diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 3ac1a3f946..db36b612a2 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -196,10 +196,9 @@ class PasswordsettingsAction extends SettingsAction } if (!$user->update($original)) { - // TRANS: Server error displayed on page where to change password when password change - // TRANS: could not be made because of a server error. - $this->serverError(_('Cannot save new password.')); - return; + // TRANS: Server error displayed on page where to change password when password change + // TRANS: could not be made because of a server error. + $this->serverError(_('Cannot save new password.')); } Event::handle('EndChangePassword', array($user)); } diff --git a/actions/peopletag.php b/actions/peopletag.php index dbdcf5fbc7..b0a6e2635d 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -78,7 +78,6 @@ class PeopletagAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('peopletag', $args), 301); - return false; } $this->tag = $tag; diff --git a/actions/peopletagautocomplete.php b/actions/peopletagautocomplete.php index 5b6ae57a53..86d63545dc 100644 --- a/actions/peopletagautocomplete.php +++ b/actions/peopletagautocomplete.php @@ -55,7 +55,6 @@ class PeopletagautocompleteAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } // CSRF protection @@ -66,7 +65,6 @@ class PeopletagautocompleteAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } $profile = $this->user->getProfile(); diff --git a/actions/peopletagged.php b/actions/peopletagged.php index 92bfce6405..cf9ec053ed 100644 --- a/actions/peopletagged.php +++ b/actions/peopletagged.php @@ -76,13 +76,11 @@ class PeopletaggedAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('peopletagged', $args), 301); - return false; } if (!$tagger) { // TRANS: Client error displayed when a tagger is expected but not provided. $this->clientError(_('No tagger.'), 404); - return false; } $user = User::getKV('nickname', $tagger); @@ -90,7 +88,6 @@ class PeopletaggedAction extends Action if (!$user) { // TRANS: Client error displayed when referring to non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagger = $user->getProfile(); @@ -99,7 +96,6 @@ class PeopletaggedAction extends Action if (!$this->peopletag) { // TRANS: Client error displayed when referring to a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } return true; diff --git a/actions/peopletagsbyuser.php b/actions/peopletagsbyuser.php index 8a5a53eca4..8b3a91917a 100644 --- a/actions/peopletagsbyuser.php +++ b/actions/peopletagsbyuser.php @@ -92,7 +92,6 @@ class PeopletagsbyuserAction extends Action $args['page'] = $this->arg['page']; } common_redirect(common_local_url('peopletagsbyuser', $args), 301); - return false; } $this->user = User::getKV('nickname', $nickname); @@ -100,7 +99,6 @@ class PeopletagsbyuserAction extends Action if (!$this->user) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagger = $this->user->getProfile(); @@ -108,7 +106,6 @@ class PeopletagsbyuserAction extends Action if (!$this->tagger) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -146,7 +143,6 @@ class PeopletagsbyuserAction extends Action if ($_SERVER['REQUEST_METHOD'] == 'POST') { common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303); - return; } $this->showPage(); diff --git a/actions/peopletagsforuser.php b/actions/peopletagsforuser.php index 83122e4105..827b284d5c 100644 --- a/actions/peopletagsforuser.php +++ b/actions/peopletagsforuser.php @@ -74,7 +74,6 @@ class PeopletagsforuserAction extends Action $args['page'] = $this->arg['page']; } common_redirect(common_local_url('peopletagsforuser', $args), 301); - return false; } $this->user = User::getKV('nickname', $nickname); @@ -82,7 +81,6 @@ class PeopletagsforuserAction extends Action if (!$this->user) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagged = $this->user->getProfile(); @@ -90,7 +88,6 @@ class PeopletagsforuserAction extends Action if (!$this->tagged) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/actions/peopletagsubscribers.php b/actions/peopletagsubscribers.php index 123b168596..589d49caa3 100644 --- a/actions/peopletagsubscribers.php +++ b/actions/peopletagsubscribers.php @@ -76,13 +76,11 @@ class PeopletagsubscribersAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('peopletagged', $args), 301); - return false; } if (!$tagger) { // TRANS: Client error displayed when a tagger is expected but not provided. $this->clientError(_('No tagger.'), 404); - return false; } $user = User::getKV('nickname', $tagger); @@ -90,7 +88,6 @@ class PeopletagsubscribersAction extends Action if (!$user) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagger = $user->getProfile(); @@ -99,7 +96,6 @@ class PeopletagsubscribersAction extends Action if (!$this->peopletag) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } return true; diff --git a/actions/peopletagsubscriptions.php b/actions/peopletagsubscriptions.php index f6baed416f..64edd09290 100644 --- a/actions/peopletagsubscriptions.php +++ b/actions/peopletagsubscriptions.php @@ -76,7 +76,6 @@ class PeopletagsubscriptionsAction extends Action $args['page'] = $this->arg['page']; } common_redirect(common_local_url('peopletagsbyuser', $args), 301); - return false; } $user = User::getKV('nickname', $nickname); @@ -84,7 +83,6 @@ class PeopletagsubscriptionsAction extends Action if (!$user) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->profile = $user->getProfile(); @@ -92,7 +90,6 @@ class PeopletagsubscriptionsAction extends Action if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/actions/pluginenable.php b/actions/pluginenable.php index d48cef0183..707cbdecaa 100644 --- a/actions/pluginenable.php +++ b/actions/pluginenable.php @@ -76,7 +76,6 @@ class PluginEnableAction extends Action // TRANS: Client error displayed when trying to use another method than POST. // TRANS: Do not translate POST. $this->clientError(_('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -87,7 +86,6 @@ class PluginEnableAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -97,13 +95,11 @@ class PluginEnableAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } if (!AdminPanelAction::canAdmin('plugins')) { // TRANS: Client error displayed when trying to enable or disable a plugin without access rights. $this->clientError(_('You cannot administer plugins.')); - return false; } $this->plugin = $this->arg('plugin'); @@ -111,7 +107,6 @@ class PluginEnableAction extends Action if (!array_key_exists($this->plugin, $defaultPlugins)) { // TRANS: Client error displayed when trying to enable or disable a non-existing plugin. $this->clientError(_('No such plugin.')); - return false; } return true; diff --git a/actions/profilecompletion.php b/actions/profilecompletion.php index b859ccc943..aaf6026eb5 100644 --- a/actions/profilecompletion.php +++ b/actions/profilecompletion.php @@ -80,7 +80,6 @@ class ProfilecompletionAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -90,7 +89,6 @@ class ProfilecompletionAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $id = $this->arg('peopletag_id'); @@ -99,7 +97,6 @@ class ProfilecompletionAction extends Action if (empty($this->peopletag)) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.')); - return false; } $field = $this->arg('field'); @@ -107,7 +104,6 @@ class ProfilecompletionAction extends Action // TRANS: Client error displayed when trying to add an unindentified field to profile. // TRANS: %s is a field name. $this->clientError(sprintf(_('Unidentified field %s.'), htmlspecialchars($field)), 404); - return false; } $this->field = $field; diff --git a/actions/profiletagbyid.php b/actions/profiletagbyid.php index f20f1bde4f..ce7298a2f6 100644 --- a/actions/profiletagbyid.php +++ b/actions/profiletagbyid.php @@ -55,7 +55,6 @@ class ProfiletagbyidAction extends Action if (!$id) { // TRANS: Client error displayed trying to perform an action without providing an ID. $this->clientError(_('No ID.')); - return false; } common_debug("Peopletag id $id by user id $tagger_id"); @@ -65,7 +64,6 @@ class ProfiletagbyidAction extends Action if (!$this->peopletag) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } $user = User::getKV('id', $tagger_id); diff --git a/actions/public.php b/actions/public.php index af2fcff842..6ecdf2e50a 100644 --- a/actions/public.php +++ b/actions/public.php @@ -102,7 +102,6 @@ class PublicAction extends Action if (!$this->notice) { // TRANS: Server error displayed when a public timeline cannot be retrieved. $this->serverError(_('Could not retrieve public timeline.')); - return; } if($this->page > 1 && $this->notice->N == 0){ diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index 1565ac9bf3..2bdb6774ea 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -35,7 +35,6 @@ class RecoverpasswordAction extends Action if (common_logged_in()) { // TRANS: Client error displayed trying to recover password while already logged in. $this->clientError(_('You are already logged in!')); - return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('recover')) { $this->recoverPassword(); @@ -62,12 +61,10 @@ class RecoverpasswordAction extends Action if (!$confirm) { // TRANS: Client error displayed when password recovery code is not correct. $this->clientError(_('No such recovery code.')); - return; } if ($confirm->address_type != 'recover') { // TRANS: Client error displayed when no proper password recovery code was submitted. $this->clientError(_('Not a recovery code.')); - return; } $user = User::getKV($confirm->user_id); @@ -75,7 +72,6 @@ class RecoverpasswordAction extends Action if (!$user) { // TRANS: Server error displayed trying to recover password without providing a user. $this->serverError(_('Recovery code for unknown user.')); - return; } $touched = strtotime($confirm->modified); @@ -89,7 +85,6 @@ class RecoverpasswordAction extends Action common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error displayed removing a password recovery code from the database. $this->serverError(_('Error with confirmation code.')); - return; } // These should be reaped, but for now we just check mod time @@ -102,7 +97,6 @@ class RecoverpasswordAction extends Action // TRANS: Client error displayed trying to recover password with too old a recovery code. $this->clientError(_('This confirmation code is too old. ' . 'Please start again.')); - return; } // If we used an outstanding confirmation to send the email, @@ -116,7 +110,6 @@ class RecoverpasswordAction extends Action common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error displayed when updating a user's e-mail address in the database fails while recovering a password. $this->serverError(_('Could not update user with confirmed email address.')); - return; } } @@ -310,7 +303,6 @@ class RecoverpasswordAction extends Action if (!$user) { // TRANS: Client error displayed when trying to reset as password without providing a user. $this->clientError(_('Unexpected password reset.')); - return; } $newpassword = $this->trimmed('newpassword'); @@ -337,7 +329,6 @@ class RecoverpasswordAction extends Action common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Reset password form validation error message. $this->serverError(_('Cannot save new password.')); - return; } $this->clearTempUser(); @@ -345,7 +336,6 @@ class RecoverpasswordAction extends Action if (!common_set_user($user->nickname)) { // TRANS: Server error displayed when something does wrong with the user object during password reset. $this->serverError(_('Error setting user.')); - return; } common_real_login(true); diff --git a/actions/redirecturl.php b/actions/redirecturl.php index 5c559a8b7e..4befa4ab84 100644 --- a/actions/redirecturl.php +++ b/actions/redirecturl.php @@ -93,7 +93,6 @@ class RedirecturlAction extends Action function handle($argarray=null) { common_redirect($this->file->url, 307); - return; } /** diff --git a/actions/register.php b/actions/register.php index 7c372892df..cf2c049e73 100644 --- a/actions/register.php +++ b/actions/register.php @@ -79,7 +79,6 @@ class RegisterAction extends Action if (common_config('site', 'inviteonly') && empty($this->code)) { // TRANS: Client error displayed when trying to register to an invite-only site without an invitation. $this->clientError(_('Sorry, only invited people can register.')); - return false; } if (!empty($this->code)) { @@ -87,7 +86,6 @@ class RegisterAction extends Action if (empty($this->invite)) { // TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation. $this->clientError(_('Sorry, invalid invitation code.')); - return false; } // Store this in case we need it common_ensure_session(); @@ -187,7 +185,6 @@ class RegisterAction extends Action if (common_config('site', 'inviteonly') && !($code && $invite)) { // TRANS: Client error displayed when trying to register to an invite-only site without an invitation. $this->clientError(_('Sorry, only invited people can register.')); - return; } // Input scrubbing @@ -387,7 +384,6 @@ class RegisterAction extends Action if (common_config('site', 'inviteonly') && !($code && $invite)) { // TRANS: Client error displayed when trying to register to an invite-only site without an invitation. $this->clientError(_('Sorry, only invited people can register.')); - return; } $this->elementStart('form', array('method' => 'post', diff --git a/actions/removepeopletag.php b/actions/removepeopletag.php index 7077573999..8192e86b44 100644 --- a/actions/removepeopletag.php +++ b/actions/removepeopletag.php @@ -78,7 +78,6 @@ class RemovepeopletagAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -88,7 +87,6 @@ class RemovepeopletagAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } // Profile to subscribe to @@ -100,7 +98,6 @@ class RemovepeopletagAction extends Action if (empty($this->tagged)) { // TRANS: Client error displayed when referring to a non-existing profile. $this->clientError(_('No such profile.')); - return false; } $id = $this->arg('peopletag_id'); @@ -109,7 +106,6 @@ class RemovepeopletagAction extends Action if (empty($this->peopletag)) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.')); - return false; } return true; @@ -146,7 +142,6 @@ class RemovepeopletagAction extends Action 'The remote server is probably not responding correctly, ' . 'please try retrying later.'), $this->profile->profileurl)); } - return false; } if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); diff --git a/actions/repeat.php b/actions/repeat.php index 9e527c5269..c926d85095 100644 --- a/actions/repeat.php +++ b/actions/repeat.php @@ -56,7 +56,6 @@ class RepeatAction extends Action if (empty($id)) { // TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID. $this->clientError(_('No notice specified.')); - return false; } $this->notice = Notice::getKV('id', $id); @@ -64,7 +63,6 @@ class RepeatAction extends Action if (!($this->notice instanceof Notice)) { // TRANS: Client error displayed when trying to repeat a non-existing notice. $this->clientError(_('No notice specified.')); - return false; } $token = $this->trimmed('token-'.$id); @@ -72,7 +70,6 @@ class RepeatAction extends Action if (empty($token) || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. Try again, please.')); - return false; } return true; diff --git a/actions/replies.php b/actions/replies.php index 4c6fba9ece..d6d2cb4ba9 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -70,7 +70,6 @@ class RepliesAction extends Action if (!$this->user) { // TRANS: Client error displayed when trying to reply to a non-exsting user. $this->clientError(_('No such user.')); - return false; } $profile = $this->user->getProfile(); @@ -78,7 +77,6 @@ class RepliesAction extends Action if (!$profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 8a8f64e0c2..145b51aaea 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -36,7 +36,6 @@ class RepliesrssAction extends Rss10Action if (!$this->user) { // TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action. $this->clientError(_('No such user.')); - return false; } else { $this->notices = $this->getNotices($this->limit); return true; diff --git a/actions/revokerole.php b/actions/revokerole.php index 1218c9e923..b55399598e 100644 --- a/actions/revokerole.php +++ b/actions/revokerole.php @@ -59,12 +59,10 @@ class RevokeRoleAction extends ProfileFormAction if (!Profile_role::isValid($this->role)) { // TRANS: Client error displayed when trying to revoke an invalid role. $this->clientError(_('Invalid role.')); - return false; } if (!Profile_role::isSettable($this->role)) { // TRANS: Client error displayed when trying to revoke a reserved role. $this->clientError(_('This role is reserved and cannot be set.')); - return false; } $cur = common_current_user(); @@ -74,7 +72,6 @@ class RevokeRoleAction extends ProfileFormAction if (!$cur->hasRight(Right::REVOKEROLE)) { // TRANS: Client error displayed when trying to revoke a role without having the right to do that. $this->clientError(_('You cannot revoke user roles on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -82,7 +79,6 @@ class RevokeRoleAction extends ProfileFormAction if (!$this->profile->hasRole($this->role)) { // TRANS: Client error displayed when trying to revoke a role that is not set. $this->clientError(_('User does not have this role.')); - return false; } return true; diff --git a/actions/rsd.php b/actions/rsd.php index 921e7584c9..1ad3b815e8 100644 --- a/actions/rsd.php +++ b/actions/rsd.php @@ -101,10 +101,7 @@ class RsdAction extends Action // Permanent redirect on non-canonical nickname if ($nickname_arg != $nickname) { - common_redirect(common_local_url('rsd', - array('nickname' => $nickname)), - 301); - return false; + common_redirect(common_local_url('rsd', array('nickname' => $nickname)), 301); } $this->user = User::getKV('nickname', $nickname); @@ -112,7 +109,6 @@ class RsdAction extends Action if (empty($this->user)) { // TRANS: Client error. $this->clientError(_('No such user.'), 404); - return false; } } diff --git a/actions/sandbox.php b/actions/sandbox.php index ddbca40b2d..af2eab3842 100644 --- a/actions/sandbox.php +++ b/actions/sandbox.php @@ -62,7 +62,6 @@ class SandboxAction extends ProfileFormAction if (!$cur->hasRight(Right::SANDBOXUSER)) { // TRANS: Client error displayed trying to sandbox users on a site where the feature is not enabled. $this->clientError(_('You cannot sandbox users on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -70,7 +69,6 @@ class SandboxAction extends ProfileFormAction if ($this->profile->isSandboxed()) { // TRANS: Client error displayed trying to sandbox an already sandboxed user. $this->clientError(_('User is already sandboxed.')); - return false; } return true; diff --git a/actions/showapplication.php b/actions/showapplication.php index acee1862f4..b44dd5746a 100644 --- a/actions/showapplication.php +++ b/actions/showapplication.php @@ -77,13 +77,11 @@ class ShowApplicationAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed trying to display an OAuth application while not logged in. $this->clientError(_('You must be logged in to view an application.')); - return false; } if (empty($this->application)) { // TRANS: Client error displayed trying to display a non-existing OAuth application. $this->clientError(_('No such application.'), 404); - return false; } $cur = common_current_user(); @@ -91,7 +89,6 @@ class ShowApplicationAction extends Action if ($cur->id != $this->owner->id) { // TRANS: Client error displayed trying to display an OAuth application for which the logged in user is not the owner. $this->clientError(_('You are not the owner of this application.'), 401); - return false; } return true; @@ -115,7 +112,6 @@ class ShowApplicationAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.')); - return; } if ($this->arg('reset')) { diff --git a/actions/showfavorites.php b/actions/showfavorites.php index a1a2dabb38..0e028416da 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -104,7 +104,6 @@ class ShowfavoritesAction extends Action if (!$this->user) { // TRANS: Client error displayed when trying to display favourite notices for a non-existing user. $this->clientError(_('No such user.')); - return false; } $this->page = $this->trimmed('page'); @@ -132,7 +131,6 @@ class ShowfavoritesAction extends Action if (empty($this->notice)) { // TRANS: Server error displayed when favourite notices could not be retrieved from the database. $this->serverError(_('Could not retrieve favorite notices.')); - return; } if($this->page > 1 && $this->notice->N == 0){ diff --git a/actions/showmessage.php b/actions/showmessage.php index 24c7db1d50..86fbee8b73 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -74,7 +74,6 @@ class ShowmessageAction extends Action if (!$this->message) { // TRANS: Client error displayed requesting a single message that does not exist. $this->clientError(_('No such message.'), 404); - return false; } $this->user = common_current_user(); diff --git a/actions/shownotice.php b/actions/shownotice.php index 1f92978062..d86e98080b 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -97,7 +97,6 @@ class ShownoticeAction extends Action if (empty($this->profile)) { // TRANS: Server error displayed trying to show a notice without a connected profile. $this->serverError(_('Notice has no profile.'), 500); - return false; } $this->user = User::getKV('id', $this->profile->id); @@ -230,7 +229,6 @@ class ShownoticeAction extends Action } if ($target && $target != $this->selfUrl()) { common_redirect($target, 301); - return false; } } $this->showPage(); diff --git a/actions/showprofiletag.php b/actions/showprofiletag.php index e7152c0046..4524e4aa8c 100644 --- a/actions/showprofiletag.php +++ b/actions/showprofiletag.php @@ -61,13 +61,11 @@ class ShowprofiletagAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('showprofiletag', $args), 301); - return false; } if (!$tagger) { // TRANS: Client error displayed when a tagger is expected but not provided. $this->clientError(_('No tagger.'), 404); - return false; } $user = User::getKV('nickname', $tagger); @@ -75,7 +73,6 @@ class ShowprofiletagAction extends Action if (!$user) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->tagger = $user->getProfile(); @@ -88,7 +85,6 @@ class ShowprofiletagAction extends Action if (!$can_see) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -114,7 +110,6 @@ class ShowprofiletagAction extends Action if (!$this->peopletag) { // TRANS: Client error displayed trying to perform an action related to a non-existing user. $this->clientError(_('No such user.')); - return; } $this->showPage(); diff --git a/actions/silence.php b/actions/silence.php index c44aa3a6d7..6a4f84deb9 100644 --- a/actions/silence.php +++ b/actions/silence.php @@ -62,7 +62,6 @@ class SilenceAction extends ProfileFormAction if (!$cur->hasRight(Right::SILENCEUSER)) { // TRANS: Client error displayed trying to silence a user on a site where the feature is not enabled. $this->clientError(_('You cannot silence users on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -70,7 +69,6 @@ class SilenceAction extends ProfileFormAction if ($this->profile->isSilenced()) { // TRANS: Client error displayed trying to silence an already silenced user. $this->clientError(_('User is already silenced.')); - return false; } return true; diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php index 40c9a841b3..b45e125189 100644 --- a/actions/siteadminpanel.php +++ b/actions/siteadminpanel.php @@ -173,7 +173,6 @@ class SiteadminpanelAction extends AdminPanelAction !in_array($values['site']['timezone'], DateTimeZone::listIdentifiers())) { // TRANS: Client error displayed trying to save site settings without a timezone. $this->clientError(_('Timezone not selected.')); - return; } // Validate language diff --git a/actions/smssettings.php b/actions/smssettings.php index a39eb2cf57..d8e219db41 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -299,7 +299,6 @@ class SmssettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating SMS preferences. $this->serverError(_('Could not update user.')); - return; } $user->query('COMMIT'); @@ -363,7 +362,6 @@ class SmssettingsAction extends SettingsAction common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding SMS confirmation code. $this->serverError(_('Could not insert confirmation code.')); - return; } $carrier = Sms_carrier::getKV($carrier_id); @@ -411,7 +409,6 @@ class SmssettingsAction extends SettingsAction common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling SMS phone number confirmation. $this->serverError(_('Could not delete SMS confirmation.')); - return; } // TRANS: Message given after successfully canceling SMS phone number confirmation. @@ -452,7 +449,6 @@ class SmssettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered SMS phone number. $this->serverError(_('Could not update user.')); - return; } $user->query('COMMIT'); diff --git a/actions/subedit.php b/actions/subedit.php index 062c4167cd..47fe19ea24 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -31,7 +31,6 @@ class SubeditAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $token = $this->trimmed('token'); @@ -40,7 +39,6 @@ class SubeditAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. '. 'Try again, please.')); - return false; } $id = $this->trimmed('profile'); @@ -48,7 +46,6 @@ class SubeditAction extends Action if (!$id) { // TRANS: Client error displayed trying a change a subscription without providing a profile. $this->clientError(_('No profile specified.')); - return false; } $this->profile = Profile::getKV('id', $id); @@ -56,7 +53,6 @@ class SubeditAction extends Action if (!$this->profile) { // TRANS: Client error displayed trying a change a subscription for a non-existant profile ID. $this->clientError(_('No profile with that ID.')); - return false; } return true; @@ -74,7 +70,6 @@ class SubeditAction extends Action if (!$sub) { // TRANS: Client error displayed trying a change a subscription for a non-subscribed profile. $this->clientError(_('You are not subscribed to that profile.')); - return false; } $orig = clone($sub); @@ -88,12 +83,9 @@ class SubeditAction extends Action common_log_db_error($sub, 'UPDATE', __FILE__); // TRANS: Server error displayed when updating a subscription fails with a database error. $this->serverError(_('Could not save subscription.')); - return false; } - common_redirect(common_local_url('subscriptions', - array('nickname' => $cur->nickname)), - 303); + common_redirect(common_local_url('subscriptions', array('nickname' => $cur->nickname)), 303); } } } diff --git a/actions/subqueue.php b/actions/subqueue.php index 38bc16e562..b1c914ebda 100644 --- a/actions/subqueue.php +++ b/actions/subqueue.php @@ -60,7 +60,6 @@ class SubqueueAction extends GalleryAction if (!$cur || $cur->id != $this->profile->id) { // TRANS: Client error displayed when trying to approve group applicants without being a group administrator. $this->clientError(_('You may only approve your own pending subscriptions.')); - return false; } return true; } diff --git a/actions/subscribe.php b/actions/subscribe.php index 36f9fc724b..4002c9fbb0 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -74,7 +74,6 @@ class SubscribeAction extends Action // TRANS: Client error displayed trying to perform any request method other than POST. // TRANS: Do not translate POST. $this->clientError(_('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -85,7 +84,6 @@ class SubscribeAction extends Action // TRANS: Client error displayed when the session token is not okay. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -95,7 +93,6 @@ class SubscribeAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } // Profile to subscribe to @@ -107,7 +104,6 @@ class SubscribeAction extends Action if (empty($this->other)) { // TRANS: Client error displayed trying to subscribe to a non-existing profile. $this->clientError(_('No such profile.')); - return false; } return true; diff --git a/actions/subscribepeopletag.php b/actions/subscribepeopletag.php index 1bb14420ff..b83ff70010 100644 --- a/actions/subscribepeopletag.php +++ b/actions/subscribepeopletag.php @@ -57,14 +57,12 @@ class SubscribepeopletagAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to perform an action while not logged in. $this->clientError(_('You must be logged in to unsubscribe from a list.')); - return false; } // Only allow POST requests if ($_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error displayed when trying to use another method than POST. $this->clientError(_('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -75,7 +73,6 @@ class SubscribepeopletagAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } $tagger_arg = $this->trimmed('tagger'); @@ -87,13 +84,11 @@ class SubscribepeopletagAction extends Action } else { // TRANS: Client error displayed when trying to perform an action without providing an ID. $this->clientError(_('No ID given.'), 404); - return false; } if (!$this->peopletag || $this->peopletag->private) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } $this->tagger = Profile::getKV('id', $this->peopletag->tagger); diff --git a/actions/tag.php b/actions/tag.php index e0cb9783d1..21cae9aba5 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -34,13 +34,10 @@ class TagAction extends Action if (!$this->tag) { common_redirect(common_local_url('publictagcloud'), 301); - return false; } if ($this->tag != $taginput) { - common_redirect(common_local_url('tag', array('tag' => $this->tag)), - 301); - return false; + common_redirect(common_local_url('tag', array('tag' => $this->tag)), 301); } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/actions/tagprofile.php b/actions/tagprofile.php index e9d855c497..7538d7c8b6 100644 --- a/actions/tagprofile.php +++ b/actions/tagprofile.php @@ -46,7 +46,6 @@ class TagprofileAction extends Action if (!$this->profile) { // TRANS: Client error displayed when referring to non-existing profile ID. $this->clientError(_('No profile with that ID.')); - return false; } } @@ -55,7 +54,6 @@ class TagprofileAction extends Action // TRANS: Client error displayed when trying to tag a user that cannot be tagged. $this->clientError(_('You cannot tag this user.')); } - return true; } function handle($args) diff --git a/actions/tagrss.php b/actions/tagrss.php index 091e383b39..468944d11f 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -33,7 +33,6 @@ class TagrssAction extends Rss10Action if (!$this->tag) { // TRANS: Client error when requesting a tag feed for a non-existing tag. $this->clientError(_('No such tag.')); - return false; } else { $this->notices = $this->getNotices($this->limit); return true; diff --git a/actions/unblock.php b/actions/unblock.php index 1f4d9606b8..82d0d32c10 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -57,7 +57,6 @@ class UnblockAction extends ProfileFormAction if (!$cur->hasBlocked($this->profile)) { // TRANS: Client error displayed when trying to unblock a non-blocked user. $this->clientError(_("You haven't blocked that user.")); - return false; } return true; @@ -84,7 +83,6 @@ class UnblockAction extends ProfileFormAction if (!$result) { // TRANS: Server error displayed when removing a user block. $this->serverError(_('Error removing the block.')); - return; } } } diff --git a/actions/unsandbox.php b/actions/unsandbox.php index 98bd2d4f54..b87736fcff 100644 --- a/actions/unsandbox.php +++ b/actions/unsandbox.php @@ -62,7 +62,6 @@ class UnsandboxAction extends ProfileFormAction if (!$cur->hasRight(Right::SANDBOXUSER)) { // TRANS: Client error on page to unsandbox a user when the feature is not enabled. $this->clientError(_('You cannot sandbox users on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -70,7 +69,6 @@ class UnsandboxAction extends ProfileFormAction if (!$this->profile->isSandboxed()) { // TRANS: Client error on page to unsilence a user when the to be unsandboxed user has not been sandboxed. $this->clientError(_('User is not sandboxed.')); - return false; } return true; diff --git a/actions/unsilence.php b/actions/unsilence.php index 723bf1bed5..c01c141b1c 100644 --- a/actions/unsilence.php +++ b/actions/unsilence.php @@ -62,7 +62,6 @@ class UnsilenceAction extends ProfileFormAction if (!$cur->hasRight(Right::SILENCEUSER)) { // TRANS: Client error on page to unsilence a user when the feature is not enabled. $this->clientError(_('You cannot silence users on this site.')); - return false; } assert(!empty($this->profile)); // checked by parent @@ -70,7 +69,6 @@ class UnsilenceAction extends ProfileFormAction if (!$this->profile->isSilenced()) { // TRANS: Client error on page to unsilence a user when the to be unsilenced user has not been silenced. $this->clientError(_('User is not silenced.')); - return false; } return true; diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 1beb295aec..4b85ba427c 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -50,13 +50,11 @@ class UnsubscribeAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return; } if ($_SERVER['REQUEST_METHOD'] != 'POST') { common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->nickname))); - return; } /* Use a session token for CSRF protection. */ @@ -67,7 +65,6 @@ class UnsubscribeAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. ' . 'Try again, please.')); - return; } $other_id = $this->arg('unsubscribeto'); @@ -75,7 +72,6 @@ class UnsubscribeAction extends Action if (!$other_id) { // TRANS: Client error displayed when trying to unsubscribe without providing a profile ID. $this->clientError(_('No profile ID in request.')); - return; } $other = Profile::getKV('id', $other_id); @@ -83,7 +79,6 @@ class UnsubscribeAction extends Action if (!($other instanceof Profile)) { // TRANS: Client error displayed when trying to unsubscribe while providing a non-existing profile ID. $this->clientError(_('No profile with that ID.')); - return; } try { @@ -104,9 +99,7 @@ class UnsubscribeAction extends Action $this->elementEnd('body'); $this->endHTML(); } else { - common_redirect(common_local_url('subscriptions', - array('nickname' => $this->scoped->nickname)), - 303); + common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->nickname)), 303); } } } diff --git a/actions/unsubscribepeopletag.php b/actions/unsubscribepeopletag.php index c739c6760c..b5757ad6fd 100644 --- a/actions/unsubscribepeopletag.php +++ b/actions/unsubscribepeopletag.php @@ -58,14 +58,12 @@ class UnsubscribepeopletagAction extends Action if (!common_logged_in()) { // TRANS: Client error displayed when trying to perform an action while not logged in. $this->clientError(_('You must be logged in to unsubscribe from a list.')); - return false; } // Only allow POST requests if ($_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error displayed when trying to use another method than POST. $this->clientError(_('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -76,7 +74,6 @@ class UnsubscribepeopletagAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.'. ' Try again, please.')); - return false; } $tagger_arg = $this->trimmed('tagger'); @@ -88,13 +85,11 @@ class UnsubscribepeopletagAction extends Action } else { // TRANS: Client error displayed when trying to perform an action without providing an ID. $this->clientError(_('No ID given.'), 404); - return false; } if (!$this->peopletag || $this->peopletag->private) { // TRANS: Client error displayed trying to reference a non-existing list. $this->clientError(_('No such list.'), 404); - return false; } $this->tagger = Profile::getKV('id', $this->peopletag->tagger); @@ -137,11 +132,8 @@ class UnsubscribepeopletagAction extends Action } else { if (common_get_returnto()) { common_redirect(common_get_returnto(), 303); - return true; } - common_redirect(common_local_url('peopletagsbyuser', - array('nickname' => $this->tagger->nickname)), - 303); + common_redirect(common_local_url('peopletagsbyuser', array('nickname' => $this->tagger->nickname)), 303); } } } diff --git a/actions/urlsettings.php b/actions/urlsettings.php index dd1218bc14..69ad4c8690 100644 --- a/actions/urlsettings.php +++ b/actions/urlsettings.php @@ -211,7 +211,6 @@ class UrlsettingsAction extends SettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server. $this->serverError(_('Could not update user.')); - return; } $prefs = User_urlshortener_prefs::getPrefs($user); diff --git a/actions/usergroups.php b/actions/usergroups.php index 45fed57d84..e2e2fff97f 100644 --- a/actions/usergroups.php +++ b/actions/usergroups.php @@ -85,7 +85,6 @@ class UsergroupsAction extends ProfileAction $args['page'] = $this->arg['page']; } common_redirect(common_local_url('usergroups', $args), 301); - return false; } $this->user = User::getKV('nickname', $nickname); @@ -93,7 +92,6 @@ class UsergroupsAction extends ProfileAction if (!$this->user) { // TRANS: Client error displayed requesting groups for a non-existing user. $this->clientError(_('No such user.'), 404); - return false; } $this->profile = $this->user->getProfile(); @@ -101,7 +99,6 @@ class UsergroupsAction extends ProfileAction if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = $this->trimmed('page', 1); diff --git a/index.php b/index.php index 82be959455..1d0aabb8bb 100644 --- a/index.php +++ b/index.php @@ -286,7 +286,6 @@ function main() // If the request is HTTP and it should be HTTPS... if ($site_ssl != 'never' && !StatusNet::isHTTPS() && common_is_sensitive($args['action'])) { common_redirect(common_local_url($args['action'], $args)); - return; } $args = array_merge($args, $_REQUEST); @@ -297,7 +296,6 @@ function main() if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) { common_redirect(common_local_url('public')); - return; } // If the site is private, and they're not on one of the "public" @@ -324,7 +322,6 @@ function main() common_set_returnto(common_local_url($action, $rargs)); common_redirect(common_local_url('login')); - return; } $action_class = ucfirst($action).'Action'; diff --git a/lib/adminpanelaction.php b/lib/adminpanelaction.php index 4868e9d492..2ac92cb5c6 100644 --- a/lib/adminpanelaction.php +++ b/lib/adminpanelaction.php @@ -69,7 +69,6 @@ class AdminPanelAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return false; } $user = common_current_user(); @@ -94,7 +93,6 @@ class AdminPanelAction extends Action if (!$user->hasRight(Right::CONFIGURESITE)) { // TRANS: Client error message thrown when a user tries to change admin settings but has no access rights. $this->clientError(_('You cannot make changes to this site.')); - return false; } // This panel must be enabled @@ -106,7 +104,6 @@ class AdminPanelAction extends Action if (!self::canAdmin($name)) { // TRANS: Client error message throw when a certain panel's settings cannot be changed. $this->clientError(_('Changes to that panel are not allowed.'), 403); - return false; } return true; @@ -220,7 +217,6 @@ class AdminPanelAction extends Action { // TRANS: Client error message. $this->clientError(_('showForm() not implemented.')); - return; } /** @@ -248,7 +244,6 @@ class AdminPanelAction extends Action { // TRANS: Client error message $this->clientError(_('saveSettings() not implemented.')); - return; } function canAdmin($name) diff --git a/lib/apiaction.php b/lib/apiaction.php index f8ffbc84a5..9f26b3b304 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -1324,7 +1324,6 @@ class ApiAction extends Action default: // TRANS: Client error on an API request with an unsupported data format. $this->clientError(_('Not a supported data format.')); - break; } return; @@ -1351,7 +1350,6 @@ class ApiAction extends Action default: // TRANS: Client error on an API request with an unsupported data format. $this->clientError(_('Not a supported data format.')); - break; } return; } @@ -1406,7 +1404,6 @@ class ApiAction extends Action default: // TRANS: Client error on an API request with an unsupported data format. $this->clientError(_('Not a supported data format.')); - return; } return; } diff --git a/lib/apilistusers.php b/lib/apilistusers.php index 42a7bc5c99..13d1a8c580 100644 --- a/lib/apilistusers.php +++ b/lib/apilistusers.php @@ -63,7 +63,6 @@ class ApiListUsersAction extends ApiBareAuthAction if (empty($this->list)) { // TRANS: Client error displayed when referring to a non-existing list. $this->clientError(_('List not found.'), 404, $this->format); - return false; } if(!$this->create && !$this->delete) { diff --git a/lib/galleryaction.php b/lib/galleryaction.php index 85e3f0de3e..975933f6cc 100644 --- a/lib/galleryaction.php +++ b/lib/galleryaction.php @@ -51,7 +51,6 @@ class GalleryAction extends ProfileAction $args['page'] = $this->arg['page']; } common_redirect(common_local_url($this->trimmed('action'), $args), 301); - return false; } $this->user = User::getKV('nickname', $nickname); @@ -59,7 +58,6 @@ class GalleryAction extends ProfileAction if (!$this->user) { // TRANS: Client error displayed when trying to perform a gallery action with an unknown user. $this->clientError(_('No such user.'), 404); - return false; } $this->profile = $this->user->getProfile(); @@ -67,7 +65,6 @@ class GalleryAction extends ProfileAction if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -91,7 +88,6 @@ class GalleryAction extends ProfileAction if ($_SERVER['REQUEST_METHOD'] == 'POST') { common_redirect($this->selfUrl(), 303); - return; } $this->showPage(); diff --git a/lib/groupaction.php b/lib/groupaction.php index 0e2867fba8..a0141a83b9 100644 --- a/lib/groupaction.php +++ b/lib/groupaction.php @@ -61,13 +61,11 @@ class GroupAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('showgroup', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed if no nickname argument was given requesting a group page. $this->clientError(_('No nickname.'), 404); - return false; } $local = Local_group::getKV('nickname', $nickname); @@ -80,12 +78,10 @@ class GroupAction extends Action $args['page'] = $this->page; } common_redirect(common_local_url('groupbyid', $args), 301); - return false; } else { common_log(LOG_NOTICE, "Couldn't find local group for nickname '$nickname'"); // TRANS: Client error displayed if no remote group with a given name was found requesting group page. $this->clientError(_('No such group.'), 404); - return false; } } @@ -94,7 +90,6 @@ class GroupAction extends Action if (!$this->group) { // TRANS: Client error displayed if no local group with a given name was found requesting group page. $this->clientError(_('No such group.'), 404); - return false; } } diff --git a/lib/mailbox.php b/lib/mailbox.php index b1720fc824..3c7281e985 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -77,16 +77,13 @@ class MailboxAction extends Action if (!$this->user) { // TRANS: Client error displayed when trying to access a mailbox without providing a user. $this->clientError(_('No such user.'), 404); - return; } $cur = common_current_user(); if (!$cur || $cur->id != $this->user->id) { // TRANS: Client error displayed when trying to access a mailbox that is not of the logged in user. - $this->clientError(_('Only the user can read their own mailboxes.'), - 403); - return; + $this->clientError(_('Only the user can read their own mailboxes.'), 403); } $this->showPage(); diff --git a/lib/profileformaction.php b/lib/profileformaction.php index 4c738523a4..bfc7a3c7de 100644 --- a/lib/profileformaction.php +++ b/lib/profileformaction.php @@ -77,7 +77,6 @@ class ProfileFormAction extends RedirectingAction if (!$id) { // TRANS: Client error displayed when trying to change user options without specifying a user to work on. $this->clientError(_('No profile specified.')); - return false; } $this->profile = Profile::getKV('id', $id); @@ -85,7 +84,6 @@ class ProfileFormAction extends RedirectingAction if (!$this->profile) { // TRANS: Client error displayed when trying to change user options without specifying an existing user to work on. $this->clientError(_('No profile with that ID.')); - return false; } return true; diff --git a/lib/settingsaction.php b/lib/settingsaction.php index 560534065f..fd4885c830 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -71,7 +71,6 @@ class SettingsAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); - return; } else if (!common_is_real_login()) { // Cookie theft means that automatic logins can't // change important settings or see private info, and diff --git a/plugins/AnonymousFave/actions/anondisfavor.php b/plugins/AnonymousFave/actions/anondisfavor.php index c54a39202c..15f1040b7c 100644 --- a/plugins/AnonymousFave/actions/anondisfavor.php +++ b/plugins/AnonymousFave/actions/anondisfavor.php @@ -58,7 +58,6 @@ class AnonDisfavorAction extends RedirectingAction // TRANS: Client error. _m('Could not disfavor notice! Please make sure your browser has cookies enabled.') ); - return; } $id = $this->trimmed('notice'); @@ -79,7 +78,6 @@ class AnonDisfavorAction extends RedirectingAction common_log_db_error($fave, 'DELETE', __FILE__); // TRANS: Server error. $this->serverError(_m('Could not delete favorite.')); - return; } $profile->blowFavesCache(); diff --git a/plugins/AnonymousFave/actions/anonfavor.php b/plugins/AnonymousFave/actions/anonfavor.php index da8757082e..2d35964c70 100644 --- a/plugins/AnonymousFave/actions/anonfavor.php +++ b/plugins/AnonymousFave/actions/anonfavor.php @@ -55,9 +55,7 @@ class AnonFavorAction extends RedirectingAction if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error. - $this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.') - ); - return; + $this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.')); } $id = $this->trimmed('notice'); @@ -67,14 +65,12 @@ class AnonFavorAction extends RedirectingAction if ($profile->hasFave($notice)) { // TRANS: Client error. $this->clientError(_m('This notice is already a favorite!')); - return; } $fave = Fave::addNew($profile, $notice); if (!$fave) { // TRANS: Server error. $this->serverError(_m('Could not create favorite.')); - return; } $profile->blowFavesCache(); diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 19ae8e9ae9..c7e074193a 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -294,7 +294,6 @@ class BookmarkPlugin extends MicroAppPlugin if (!$this->user) { // TRANS: Client error displayed when trying to display bookmarks for a non-existing user. $this->clientError(_('No such user.')); - return false; } $action->menuItem(common_local_url('bookmarks', array('nickname' => $this->user->nickname)), diff --git a/plugins/Bookmark/actions/apitimelinebookmarks.php b/plugins/Bookmark/actions/apitimelinebookmarks.php index 4cc0dcde7f..01ef20a8c8 100644 --- a/plugins/Bookmark/actions/apitimelinebookmarks.php +++ b/plugins/Bookmark/actions/apitimelinebookmarks.php @@ -66,7 +66,6 @@ class ApiTimelineBookmarksAction extends ApiBareAuthAction if (empty($this->user)) { // TRANS: Client error displayed when requesting most recent favourite notices by a user for a non-existing user. $this->clientError(_('No such user.'), 404, $this->format); - return; } $this->notices = $this->getNotices(); @@ -172,7 +171,6 @@ class ApiTimelineBookmarksAction extends ApiBareAuthAction default: // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), $code = 404); - break; } } diff --git a/plugins/Bookmark/actions/bookmarks.php b/plugins/Bookmark/actions/bookmarks.php index fce1185cb5..23ef0ec5fc 100644 --- a/plugins/Bookmark/actions/bookmarks.php +++ b/plugins/Bookmark/actions/bookmarks.php @@ -80,7 +80,6 @@ class BookmarksAction extends Action if (!$this->user) { // TRANS: Client error displayed when trying to display bookmarks for a non-existing user. $this->clientError(_('No such user.')); - return false; } $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; diff --git a/plugins/Bookmark/actions/bookmarksrss.php b/plugins/Bookmark/actions/bookmarksrss.php index c48ab90934..fc3331482f 100644 --- a/plugins/Bookmark/actions/bookmarksrss.php +++ b/plugins/Bookmark/actions/bookmarksrss.php @@ -71,7 +71,6 @@ class BookmarksrssAction extends Rss10Action if (!$this->user) { // TRANS: Client error displayed when trying to get the RSS feed with bookmarks of a user that does not exist. $this->clientError(_('No such user.')); - return false; } else { $this->notices = $this->getNotices($this->limit); return true; diff --git a/plugins/CasAuthentication/actions/caslogin.php b/plugins/CasAuthentication/actions/caslogin.php index 9d0fcb0507..09377c62eb 100644 --- a/plugins/CasAuthentication/actions/caslogin.php +++ b/plugins/CasAuthentication/actions/caslogin.php @@ -39,14 +39,12 @@ class CasloginAction extends Action if (!$user) { // TRANS: Server error displayed when trying to log in with incorrect username or password. $this->serverError(_m('Incorrect username or password.')); - return; } // success! if (!common_set_user($user)) { // TRANS: Server error displayed when login fails in CAS authentication plugin. $this->serverError(_m('Error setting user. You are probably not authorized.')); - return; } common_real_login(true); diff --git a/plugins/EmailRegistration/actions/emailregister.php b/plugins/EmailRegistration/actions/emailregister.php index 39eb76d599..aa7f4d6ab6 100644 --- a/plugins/EmailRegistration/actions/emailregister.php +++ b/plugins/EmailRegistration/actions/emailregister.php @@ -191,7 +191,6 @@ class EmailregisterAction extends Action if (!empty($cur)) { common_redirect(common_local_url('all', array('nickname' => $cur->nickname))); - return; } switch ($this->state) { diff --git a/plugins/Event/actions/timelist.php b/plugins/Event/actions/timelist.php index cb8efb3c1d..092fa6bda5 100644 --- a/plugins/Event/actions/timelist.php +++ b/plugins/Event/actions/timelist.php @@ -63,7 +63,6 @@ class TimelistAction extends Action { if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); - return; } if (!empty($this->start)) { @@ -71,7 +70,6 @@ class TimelistAction extends Action { } else { // TRANS: Client error when submitting a form with unexpected information. $this->clientError(_m('Unexpected form submission.')); - return; } if ($this->boolean('ajax')) { diff --git a/plugins/ExtendedProfile/actions/profiledetailsettings.php b/plugins/ExtendedProfile/actions/profiledetailsettings.php index 5bc2443481..8d8a33ec44 100644 --- a/plugins/ExtendedProfile/actions/profiledetailsettings.php +++ b/plugins/ExtendedProfile/actions/profiledetailsettings.php @@ -620,7 +620,6 @@ class ProfileDetailSettingsAction extends ProfileSettingsAction common_log_db_error($profile, 'UPDATE', __FILE__); // TRANS: Server error thrown when user profile settings could not be saved. $this->serverError(_m('Could not save profile.')); - return; } // Set the user tags @@ -629,7 +628,6 @@ class ProfileDetailSettingsAction extends ProfileSettingsAction if (!$result) { // TRANS: Server error thrown when user profile settings tags could not be saved. $this->serverError(_m('Could not save tags.')); - return; } Event::handle('EndProfileSaveForm', array($this)); diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php index 21b2cd1f2c..b6c1f16f50 100644 --- a/plugins/FacebookBridge/FacebookBridgePlugin.php +++ b/plugins/FacebookBridge/FacebookBridgePlugin.php @@ -414,7 +414,6 @@ ENDOFSCRIPT; $action->logout(); common_redirect($logoutUrl, 303); - return false; // probably never get here, but hey } return true; diff --git a/plugins/FacebookBridge/actions/facebookfinishlogin.php b/plugins/FacebookBridge/actions/facebookfinishlogin.php index ab83601ce1..53815ad264 100644 --- a/plugins/FacebookBridge/actions/facebookfinishlogin.php +++ b/plugins/FacebookBridge/actions/facebookfinishlogin.php @@ -48,7 +48,6 @@ class FacebookfinishloginAction extends Action if (empty($this->accessToken)) { $this->clientError(_m("Unable to authenticate you with Facebook.")); - return false; } $graphUrl = 'https://graph.facebook.com/me?access_token=' . urlencode($this->accessToken); @@ -117,8 +116,6 @@ class FacebookfinishloginAction extends Action // TRANS: in the same StatusNet site. _m('There is already a local account linked with that Facebook account.') ); - - return; } $cur = common_current_user(); @@ -133,8 +130,6 @@ class FacebookfinishloginAction extends Action // TRANS: in the same StatusNet site. _m('There is already a local account linked with that Facebook account.') ); - - return; } } @@ -329,7 +324,6 @@ class FacebookfinishloginAction extends Action if (common_config('site', 'closed')) { // TRANS: Client error trying to register with registrations not allowed. $this->clientError(_m('Registration not allowed.')); - return; } $invite = null; @@ -339,7 +333,6 @@ class FacebookfinishloginAction extends Action if (empty($code)) { // TRANS: Client error trying to register with registrations 'invite only'. $this->clientError(_m('Registration not allowed.')); - return; } $invite = Invitation::getKV($code); @@ -347,7 +340,6 @@ class FacebookfinishloginAction extends Action if (empty($invite)) { // TRANS: Client error trying to register with an invalid invitation code. $this->clientError(_m('Not a valid invitation code.')); - return; } } @@ -384,7 +376,6 @@ class FacebookfinishloginAction extends Action if (!$result) { // TRANS: Server error displayed when connecting to Facebook fails. $this->serverError(_m('Error connecting user to Facebook.')); - return; } // Add a Foreign_user record @@ -518,7 +509,6 @@ class FacebookfinishloginAction extends Action if (empty($result)) { // TRANS: Server error displayed when connecting to Facebook fails. $this->serverError(_m('Error connecting user to Facebook.')); - return; } } diff --git a/plugins/FacebookBridge/actions/facebooksettings.php b/plugins/FacebookBridge/actions/facebooksettings.php index 3f56421b4f..31e020a3ce 100644 --- a/plugins/FacebookBridge/actions/facebooksettings.php +++ b/plugins/FacebookBridge/actions/facebooksettings.php @@ -261,7 +261,6 @@ class FacebooksettingsAction extends SettingsAction { common_log_db_error($user, 'DELETE', __FILE__); // TRANS: Server error displayed when deleting the link to a Facebook account fails. $this->serverError(_m('Could not delete link to Facebook.')); - return; } // TRANS: Confirmation message. StatusNet account was unlinked from Facebook. diff --git a/plugins/GNUsocialProfileExtensions/actions/profilefields.php b/plugins/GNUsocialProfileExtensions/actions/profilefields.php index 0076af1bd6..1feea86771 100644 --- a/plugins/GNUsocialProfileExtensions/actions/profilefields.php +++ b/plugins/GNUsocialProfileExtensions/actions/profilefields.php @@ -63,14 +63,12 @@ class ProfilefieldsAdminPanelAction extends AdminPanelAction $field->systemname = $this->trimmed('systemname'); if (!gnusocial_field_systemname_validate($field->systemname)) { $this->clientError(_('Internal system name must be unique and consist of only alphanumeric characters!')); - return false; } if ($field->id) { if ($field->validate()) $field->update(); else { $this->clientError(_('There was an error with the field data.')); - return false; } } else { diff --git a/plugins/GroupPrivateMessage/actions/groupinbox.php b/plugins/GroupPrivateMessage/actions/groupinbox.php index 84952d0b06..f4656bfd8e 100644 --- a/plugins/GroupPrivateMessage/actions/groupinbox.php +++ b/plugins/GroupPrivateMessage/actions/groupinbox.php @@ -73,7 +73,6 @@ class GroupinboxAction extends GroupAction if ($nickname != $nicknameArg) { $url = common_local_url('groupinbox', array('nickname' => $nickname)); common_redirect($url); - return false; } $localGroup = Local_group::getKV('nickname', $nickname); diff --git a/plugins/GroupPrivateMessage/actions/newgroupmessage.php b/plugins/GroupPrivateMessage/actions/newgroupmessage.php index 9b611edc86..be6a3cd86b 100644 --- a/plugins/GroupPrivateMessage/actions/newgroupmessage.php +++ b/plugins/GroupPrivateMessage/actions/newgroupmessage.php @@ -81,7 +81,6 @@ class NewgroupmessageAction extends Action if ($nickname != $nicknameArg) { $url = common_local_url('newgroupmessage', array('nickname' => $nickname)); common_redirect($url, 301); - return false; } $localGroup = Local_group::getKV('nickname', $nickname); diff --git a/plugins/Irc/lib/ircmanager.php b/plugins/Irc/lib/ircmanager.php index 3c0a504eb0..3dae68d133 100644 --- a/plugins/Irc/lib/ircmanager.php +++ b/plugins/Irc/lib/ircmanager.php @@ -245,7 +245,6 @@ class IrcManager extends ImManager { common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error when deleting IRC nickname confirmation. $this->serverError(_m('Could not delete confirmation.')); - return; } } } diff --git a/plugins/Mapstraction/actions/map.php b/plugins/Mapstraction/actions/map.php index 15f3b941d7..c03e6119d8 100644 --- a/plugins/Mapstraction/actions/map.php +++ b/plugins/Mapstraction/actions/map.php @@ -63,7 +63,6 @@ class MapAction extends Action $args['page'] = $this->arg['page']; } common_redirect(common_local_url($this->trimmed('action'), $args), 301); - return false; } $this->user = User::getKV('nickname', $nickname); @@ -71,7 +70,6 @@ class MapAction extends Action if (!$this->user) { // TRANS: Client error displayed when referring to a non-existing user. $this->clientError(_m('No such user.'), 404); - return false; } $this->profile = $this->user->getProfile(); @@ -79,7 +77,6 @@ class MapAction extends Action if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_m('User has no profile.')); - return false; } $page = $this->trimmed('page'); diff --git a/plugins/Minify/actions/minify.php b/plugins/Minify/actions/minify.php index b7bee7c881..d7ec5d1392 100644 --- a/plugins/Minify/actions/minify.php +++ b/plugins/Minify/actions/minify.php @@ -48,12 +48,10 @@ class MinifyAction extends Action } else { // TRANS: Client error displayed when not providing a valid path in parameter "f". $this->clientError(_m('The parameter "f" is not a valid path.'),404); - return false; } }else{ // TRANS: Client error displayed when not providing parameter "f". $this->clientError(_m('The parameter "f" is required but missing.'),500); - return false; } } @@ -112,7 +110,6 @@ class MinifyAction extends Action default: // TRANS: Client error displayed when trying to minify an unsupported file type. $this->clientError(_m('File type not supported.'),500); - return false; } return $out; } diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 75d4fb74bc..eeb3fffd28 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -281,7 +281,6 @@ class OStatusPlugin extends Plugin // redirect to the new profile. common_redirect(common_local_url('tagprofile', array('id' => $oprofile->profile_id)), 303); - return false; } catch (Exception $e) { // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com diff --git a/plugins/OStatus/actions/groupsalmon.php b/plugins/OStatus/actions/groupsalmon.php index c8b2a73b68..e23312055f 100644 --- a/plugins/OStatus/actions/groupsalmon.php +++ b/plugins/OStatus/actions/groupsalmon.php @@ -145,7 +145,6 @@ class GroupsalmonAction extends SalmonAction if (Group_block::isBlocked($this->group, $profile)) { // TRANS: Client error displayed when trying to join a group the user is blocked from by a group admin. $this->clientError(_m('You have been blocked from that group by the admin.'), 403); - return false; } try { diff --git a/plugins/OStatus/actions/ostatustag.php b/plugins/OStatus/actions/ostatustag.php index 15392855cb..fa999fe09a 100644 --- a/plugins/OStatus/actions/ostatustag.php +++ b/plugins/OStatus/actions/ostatustag.php @@ -38,7 +38,6 @@ class OStatusTagAction extends OStatusInitAction if (common_logged_in()) { // TRANS: Client error displayed when trying to list a local object as if it is remote. $this->clientError(_m('You can use the local list functionality!')); - return false; } $this->nickname = $this->trimmed('nickname'); diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index b0bdc2885c..5adb566626 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -132,10 +132,8 @@ class OpenIDPlugin extends Plugin $action = trim($args['action']); if (in_array($action, array('login', 'register'))) { common_redirect(common_local_url('openidlogin')); - exit(0); } else if ($action == 'passwordsettings') { common_redirect(common_local_url('openidsettings')); - exit(0); } else if ($action == 'recoverpassword') { // TRANS: Client exception thrown when an action is not available. throw new ClientException(_m('Unavailable action.')); @@ -444,7 +442,6 @@ class OpenIDPlugin extends Plugin { if (common_config('site', 'openid_only') || (!empty($user) && User_openid::hasOpenID($user->id))) { common_redirect(common_local_url('openidlogin'), 303); - return false; } return true; } diff --git a/plugins/OpenID/actions/finishopenidlogin.php b/plugins/OpenID/actions/finishopenidlogin.php index 372c1e12b5..3a99988fb5 100644 --- a/plugins/OpenID/actions/finishopenidlogin.php +++ b/plugins/OpenID/actions/finishopenidlogin.php @@ -322,7 +322,6 @@ class FinishopenidloginAction extends Action if (common_config('site', 'closed')) { // TRANS: OpenID plugin message. No new user registration is allowed on the site. $this->clientError(_m('Registration not allowed.')); - return; } $invite = null; @@ -332,7 +331,6 @@ class FinishopenidloginAction extends Action if (empty($code)) { // TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided. $this->clientError(_m('Registration not allowed.')); - return; } $invite = Invitation::getKV($code); @@ -340,7 +338,6 @@ class FinishopenidloginAction extends Action if (empty($invite)) { // TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid. $this->clientError(_m('Not a valid invitation code.')); - return; } } @@ -356,7 +353,6 @@ class FinishopenidloginAction extends Action if (!$display || !$canonical) { // TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved. $this->serverError(_m('Stored OpenID not found.')); - return; } // Possible race condition... let's be paranoid @@ -366,7 +362,6 @@ class FinishopenidloginAction extends Action if ($other) { // TRANS: OpenID plugin server error. $this->serverError(_m('Creating new account for OpenID that already has a user.')); - return; } Event::handle('StartOpenIDCreateNewUser', array($canonical, &$sreg)); @@ -418,8 +413,7 @@ class FinishopenidloginAction extends Action Event::handle('EndRegistrationTry', array($this)); - common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), - 303); + common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303); } function connectUser() @@ -442,7 +436,6 @@ class FinishopenidloginAction extends Action if (!$display || !$canonical) { // TRANS: OpenID plugin server error. A stored OpenID cannot be found. $this->serverError(_m('Stored OpenID not found.')); - return; } $result = oid_link_user($user->id, $canonical, $display); @@ -450,7 +443,6 @@ class FinishopenidloginAction extends Action if (!$result) { // TRANS: OpenID plugin server error. The user or user profile could not be saved. $this->serverError(_m('Error connecting user to OpenID.')); - return; } if (Event::handle('StartOpenIDUpdateUser', array($user, $canonical, &$sreg))) { diff --git a/plugins/OpenID/actions/openidserver.php b/plugins/OpenID/actions/openidserver.php index 847eb48c65..b50a9129d7 100644 --- a/plugins/OpenID/actions/openidserver.php +++ b/plugins/OpenID/actions/openidserver.php @@ -76,7 +76,6 @@ class OpenidserverAction extends Action // were POSTed here. common_set_returnto($_SERVER['REQUEST_URI']); common_redirect(common_local_url('login'), 303); - return; } }else if(common_profile_url($user->nickname) == $request->identity || $request->idSelect()){ $user_openid_trustroot = User_openid_trustroot::pkeyGet( @@ -101,7 +100,6 @@ class OpenidserverAction extends Action // prompting user for form resubmission if we // were POSTed here. common_redirect(common_local_url('openidtrust'), 303); - return; } }else{ //user has previously authorized this trust root diff --git a/plugins/OpenID/actions/openidtrust.php b/plugins/OpenID/actions/openidtrust.php index 8f046429a0..3f8a3a93b7 100644 --- a/plugins/OpenID/actions/openidtrust.php +++ b/plugins/OpenID/actions/openidtrust.php @@ -60,7 +60,6 @@ class OpenidtrustAction extends Action /* Go log in, and then come back. */ common_set_returnto($_SERVER['REQUEST_URI']); common_redirect(common_local_url('login')); - return; } $this->trust_root = $_SESSION['openid_trust_root']; $this->allowUrl = $_SESSION['openid_allow_url']; @@ -68,7 +67,6 @@ class OpenidtrustAction extends Action if(empty($this->trust_root) || empty($this->allowUrl) || empty($this->denyUrl)){ // TRANS: Client error when visiting page directly. $this->clientError(_m('This page should only be reached during OpenID processing, not directly.')); - return; } return true; } diff --git a/plugins/SearchSub/actions/searchsub.php b/plugins/SearchSub/actions/searchsub.php index dcd072e8f8..cf9e5e5e94 100644 --- a/plugins/SearchSub/actions/searchsub.php +++ b/plugins/SearchSub/actions/searchsub.php @@ -76,7 +76,6 @@ class SearchsubAction extends Action // TRANS: Client error displayed trying to perform any request method other than POST. // TRANS: Do not translate POST. $this->clientError(_m('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -87,7 +86,6 @@ class SearchsubAction extends Action // TRANS: Client error displayed when the session token is not okay. $this->clientError(_m('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -97,7 +95,6 @@ class SearchsubAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); - return false; } // Profile to subscribe to @@ -107,7 +104,6 @@ class SearchsubAction extends Action if (empty($this->search)) { // TRANS: Client error displayed trying to subscribe to a non-existing profile. $this->clientError(_m('No such profile.')); - return false; } return true; diff --git a/plugins/SubMirror/actions/basemirror.php b/plugins/SubMirror/actions/basemirror.php index b3dc1a0517..8ed6c224e7 100644 --- a/plugins/SubMirror/actions/basemirror.php +++ b/plugins/SubMirror/actions/basemirror.php @@ -116,7 +116,6 @@ abstract class BaseMirrorAction extends Action if ($_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error displayed when trying to use another method than POST. $this->clientError(_m('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -126,7 +125,6 @@ abstract class BaseMirrorAction extends Action // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_m('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -136,7 +134,6 @@ abstract class BaseMirrorAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); - return false; } return true; } diff --git a/plugins/TagSub/actions/tagsub.php b/plugins/TagSub/actions/tagsub.php index dd8c76b53d..4550716cab 100644 --- a/plugins/TagSub/actions/tagsub.php +++ b/plugins/TagSub/actions/tagsub.php @@ -76,7 +76,6 @@ class TagsubAction extends Action // TRANS: Client error displayed trying to perform any request method other than POST. // TRANS: Do not translate POST. $this->clientError(_m('This action only accepts POST requests.')); - return false; } // CSRF protection @@ -87,7 +86,6 @@ class TagsubAction extends Action // TRANS: Client error displayed when the session token is not okay. $this->clientError(_m('There was a problem with your session token.'. ' Try again, please.')); - return false; } // Only for logged-in users @@ -97,7 +95,6 @@ class TagsubAction extends Action if (empty($this->user)) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); - return false; } // Profile to subscribe to @@ -107,7 +104,6 @@ class TagsubAction extends Action if (empty($this->tag)) { // TRANS: Client error displayed trying to subscribe to a non-existing profile. $this->clientError(_m('No such profile.')); - return false; } return true; diff --git a/plugins/TwitterBridge/actions/twitterauthorization.php b/plugins/TwitterBridge/actions/twitterauthorization.php index 3c95d243c4..aace7e4f09 100644 --- a/plugins/TwitterBridge/actions/twitterauthorization.php +++ b/plugins/TwitterBridge/actions/twitterauthorization.php @@ -496,7 +496,6 @@ class TwitterauthorizationAction extends Action if (common_config('site', 'closed')) { // TRANS: Client error displayed when trying to create a new user while creating new users is not allowed. $this->clientError(_m('Registration not allowed.')); - return; } $invite = null; @@ -506,7 +505,6 @@ class TwitterauthorizationAction extends Action if (empty($code)) { // TRANS: Client error displayed when trying to create a new user while creating new users is not allowed. $this->clientError(_m('Registration not allowed.')); - return; } $invite = Invitation::getKV($code); @@ -514,7 +512,6 @@ class TwitterauthorizationAction extends Action if (empty($invite)) { // TRANS: Client error displayed when trying to create a new user with an invalid invitation code. $this->clientError(_m('Not a valid invitation code.')); - return; } } @@ -543,7 +540,6 @@ class TwitterauthorizationAction extends Action if (empty($user)) { // TRANS: Server error displayed when creating a new user has failed. $this->serverError(_m('Error registering user.')); - return; } $result = $this->saveForeignLink($user->id, @@ -555,7 +551,6 @@ class TwitterauthorizationAction extends Action if (!$result) { // TRANS: Server error displayed when connecting a user to a Twitter user has failed. $this->serverError(_m('Error connecting user to Twitter.')); - return; } common_set_user($user); @@ -566,8 +561,7 @@ class TwitterauthorizationAction extends Action Event::handle('EndRegistrationTry', array($this)); - common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), - 303); + common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303); } function connectNewUser() @@ -598,7 +592,6 @@ class TwitterauthorizationAction extends Action if (!$result) { // TRANS: Server error displayed connecting a user to a Twitter user has failed. $this->serverError(_m('Error connecting user to Twitter.')); - return; } common_debug('TwitterBridge Plugin - ' . @@ -619,7 +612,6 @@ class TwitterauthorizationAction extends Action if (empty($result)) { // TRANS: Server error displayed connecting a user to a Twitter user has failed. $this->serverError(_m('Error connecting user to Twitter.')); - return; } common_debug('TwitterBridge Plugin - ' . diff --git a/plugins/TwitterBridge/actions/twittersettings.php b/plugins/TwitterBridge/actions/twittersettings.php index 88799e75a9..cc3e34f345 100644 --- a/plugins/TwitterBridge/actions/twittersettings.php +++ b/plugins/TwitterBridge/actions/twittersettings.php @@ -263,7 +263,6 @@ class TwittersettingsAction extends ProfileSettingsAction if (empty($flink)) { // TRANS: Client error displayed when trying to remove a connected Twitter account when there isn't one connected. $this->clientError(_m('No Twitter connection to remove.')); - return; } $result = $flink->safeDelete(); @@ -272,7 +271,6 @@ class TwittersettingsAction extends ProfileSettingsAction common_log_db_error($flink, 'DELETE', __FILE__); // TRANS: Server error displayed when trying to remove a connected Twitter account fails. $this->serverError(_m('Could not remove Twitter user.')); - return; } // TRANS: Success message displayed after disconnecting a Twitter account. diff --git a/plugins/UserFlag/actions/adminprofileflag.php b/plugins/UserFlag/actions/adminprofileflag.php index b7538c6663..9b5b4088bf 100644 --- a/plugins/UserFlag/actions/adminprofileflag.php +++ b/plugins/UserFlag/actions/adminprofileflag.php @@ -63,7 +63,6 @@ class AdminprofileflagAction extends Action if (!common_logged_in()) { // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); - return; } $user = common_current_user(); @@ -88,7 +87,6 @@ class AdminprofileflagAction extends Action if (!$user->hasRight(UserFlagPlugin::REVIEWFLAGS)) { // TRANS: Error message displayed when trying to review profile flags while not authorised. $this->clientError(_m('You cannot review profile flags.')); - return false; } $this->page = $this->trimmed('page'); -- 2.39.2