]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Confirm there's actually user and domain portions of acct string before assigning...
authorBrion Vibber <brion@pobox.com>
Mon, 22 Mar 2010 18:27:39 +0000 (11:27 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 22 Mar 2010 18:27:39 +0000 (11:27 -0700)
plugins/OStatus/actions/userxrd.php

index eb80a5ad46930d801be6e82735a04fb2a9866010..6a6886eb8c78c06c5126680f68be94df26ac3472 100644 (file)
@@ -35,9 +35,13 @@ class UserxrdAction extends XrdAction
         $this->uri = Discovery::normalize($this->uri);
         
         if (Discovery::isWebfinger($this->uri)) {
-            list($nick, $domain) = explode('@', substr(urldecode($this->uri), 5));
-            $nick = common_canonical_nickname($nick);
-            $this->user = User::staticGet('nickname', $nick);
+            $parts = explode('@', substr(urldecode($this->uri), 5));
+            if (count($parts) == 2) {
+                list($nick, $domain) = $parts;
+                // @fixme confirm the domain too
+                $nick = common_canonical_nickname($nick);
+                $this->user = User::staticGet('nickname', $nick);
+            }
         } else {
             $this->user = User::staticGet('uri', $this->uri);
         }