]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/block.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / actions / block.php
index f195fb5a88ffc8663373feccf94898c6811b4253..018c6782fcbd5f368b1a856dfcde64c62e5e03e8 100644 (file)
@@ -53,7 +53,7 @@ class BlockAction extends ProfileFormAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         if (!parent::prepare($args)) {
             return false;
@@ -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;
@@ -75,13 +74,11 @@ class BlockAction extends ProfileFormAction
     /**
      * Handle request
      *
-     * Shows a page with list of favorite notices
-     *
      * @param array $args $_REQUEST args; handled in prepare()
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             if ($this->arg('no')) {
@@ -187,7 +184,6 @@ class BlockAction extends ProfileFormAction
         if (!$result) {
             // TRANS: Server error displayed when blocking a user fails.
             $this->serverError(_('Failed to save block information.'));
-            return;
         }
     }
 
@@ -224,7 +220,8 @@ class BlockAction extends ProfileFormAction
     function defaultReturnTo()
     {
         $user = common_current_user();
-        if ($user) {
+
+        if ($user instanceof User) {
             return common_local_url('subscribers',
                                     array('nickname' => $user->nickname));
         } else {