- $listFeed = common_local_url('ApiTimelineList', $params);
-
- if ($feed == $listFeed) {
- $list = Profile_list::staticGet('id', $id);
- $user = User::staticGet('id', $user);
- if (!$list || !$user || $list->tagger != $user->id) {
- throw new ClientException("Invalid hub.topic $feed; people tag doesn't exist.");
- } else {
- return true;
+
+ // 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));