]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Less frightening interface on remote subscription
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 19 Apr 2017 09:41:34 +0000 (11:41 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 19 Apr 2017 09:44:07 +0000 (11:44 +0200)
Instead of an error message in a red box about being unable to find the
profile, you get the title "Remote subscription" and no error message.

plugins/OStatus/actions/ostatussub.php

index 7531bb688644faa556684b799566702f317daf6d..919737ba285a3f959d57ce729216584026dbaf0f 100644 (file)
@@ -245,8 +245,9 @@ class OStatusSubAction extends Action
         try {
             $this->profile_uri = Discovery::normalize($this->trimmed('profile'));
         } catch (Exception $e) {
-            $this->profile_uri = null;
+            return false;
         }
+
         try {
             if (Discovery::isAcct($this->profile_uri) && $validate->email(mb_substr($this->profile_uri, 5))) {
                 $this->oprofile = Ostatus_profile::ensureWebfinger($this->profile_uri);
@@ -391,7 +392,7 @@ class OStatusSubAction extends Action
     function title()
     {
         // TRANS: Page title for OStatus remote subscription form.
-        return _m('Confirm');
+        return !empty($this->profile_uri) ? _m('Confirm') : _m('Remote subscription');
     }
 
     /**