]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
Merge branch 'fix-setpassword' into 'nightly'
[quix0rs-gnu-social.git] / classes / Profile.php
index 5ef77a9506fb5c48b63ba966f2bd69b3c05be11b..49addfe47fe887d72d84f73c57fde62c25ed1098 100644 (file)
@@ -1593,8 +1593,20 @@ class Profile extends Managed_DataObject
         return $this;
     }
 
-    public function sameAs(Profile $other)
+    /**
+     * Test whether the given profile is the same as the current class,
+     * for testing identities.
+     *
+     * @param Profile $other    The other profile, usually from Action's $this->scoped
+     *
+     * @return boolean
+     */
+    public function sameAs(Profile $other=null)
     {
+        if (is_null($other)) {
+            // In case $this->scoped is null or something, i.e. not a current/legitimate profile.
+            return false;
+        }
         return $this->getID() === $other->getID();
     }