]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only allow RSSCloud subs to canonical RSS2 profile feeds
authorZach Copley <zach@status.net>
Mon, 8 Mar 2010 22:53:43 +0000 (22:53 +0000)
committerZach Copley <zach@status.net>
Mon, 8 Mar 2010 22:53:43 +0000 (22:53 +0000)
plugins/RSSCloud/RSSCloudRequestNotify.php

index d76c08d379aedef609c28d851de3a897b5e72a7e..03052953486e9da683c030855da8182ce00b2508 100644 (file)
@@ -270,13 +270,14 @@ class RSSCloudRequestNotifyAction extends Action
 
     function userFromFeed($feed)
     {
-        // We only do profile feeds
+        // We only do canonical RSS2 profile feeds (specified by ID), e.g.:
+        // http://www.example.com/api/statuses/user_timeline/2.rss
 
         $path  = common_path('api/statuses/user_timeline/');
-        $valid = '%^' . $path . '(?<nickname>.*)\.rss$%';
+        $valid = '%^' . $path . '(?<id>.*)\.rss$%';
 
         if (preg_match($valid, $feed, $matches)) {
-            $user = User::staticGet('nickname', $matches['nickname']);
+            $user = User::staticGet('id', $matches['id']);
             if (!empty($user)) {
                 return $user;
             }