- if ($feed == $groupFeed) {
- $user = User_group::staticGet('id', $id);
- if (!$user) {
- // TRANS: Client exception.
- throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group doesn\'t exist.'),$feed));
- } else {
- return true;
+ common_debug("Feed was not recognized by any local User or Group Atom feed URLs: {$feed}");
+ return false;
+ }
+
+ // Profile lists are unique per user, so we need both IDs
+ if (preg_match('!/(\d+)/lists/(\d+)/statuses\.atom$!', $feed, $matches)) {
+ $user = $matches[1];
+ $id = $matches[2];
+ $params = array('user' => $user, 'id' => $id, 'format' => 'atom');
+
+ // Double-check against locally generated URLs
+ switch ($feed) {
+ case common_local_url('ApiTimelineList', $params):
+ $list = Profile_list::getKV('id', $id);
+ $user = User::getKV('id', $user);
+ if (!$list instanceof Profile_list || !$user instanceof User || $list->tagger != $user->id) {
+ // TRANS: Client exception. %s is a feed URL.
+ throw new ClientException(sprintf(_m('Invalid hub.topic %s; list does not exist.'),$feed));