]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Those variables were set for a reason
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Jan 2015 11:56:56 +0000 (12:56 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Jan 2015 11:56:56 +0000 (12:56 +0100)
The ->_subscription variable etc. were set because they were used later.

actions/atompubshowmembership.php
actions/atompubshowsubscription.php

index 1e9d66c56b310990566db4f37bcfce240da71f89..16196917698ac5c8e2706929477329dab0de6064 100644 (file)
@@ -67,7 +67,7 @@ class AtompubshowmembershipAction extends AtompubAction
 
         $this->_membership = Group_member::pkeyGet($kv);
 
-        if (!$this->_profile->isMembmer($this->_group)) {
+        if (!$this->_membership instanceof Group_member) {
             // TRANS: Client exception thrown when trying to show membership of a non-subscribed group
             throw new ClientException(_('Not a member.'), 404);
         }
index 0d8c3615196186ee5ac241207d79e3487bdd6d51..ee5a477d49eca4a75d04264b8137f8dd4c33260e 100644 (file)
@@ -70,7 +70,9 @@ class AtompubshowsubscriptionAction extends AtompubAction
                                               $subscribedId), 404);
         }
 
-        if (!$this->_subscriber->isSubscribed($this->_subscribed)) {
+        $this->_subscription = Subscription::pkeyGet(array('subscriber' => $subscriberId,
+                                                           'subscribed' => $subscribedId));
+        if (!$this->_subscription instanceof Subscription) {
             // TRANS: Client exception thrown when trying to display a subscription for a non-subscribed profile ID.
             // TRANS: %1$d is the non-existing subscriber ID number, $2$d is the ID of the profile that was not subscribed to.
             $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d.'),