diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-06-23 13:51:23 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-06-23 13:51:23 -0700 |
commit | 31325f0995bb61413b07f166d253b13fb27d085d (patch) | |
tree | 1ae7cdadfcdbf5b76e08db0a5a8df3cd4cb4e25f /actions/showfavorites.php | |
parent | d9bebfd6512353690be8bf8cc596a0656ef48ae9 (diff) |
Stop Twitter gateway notices from leaking via user faves pages
Diffstat (limited to 'actions/showfavorites.php')
-rw-r--r-- | actions/showfavorites.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 01f38a892..b723924a5 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -191,10 +191,21 @@ class ShowfavoritesAction extends CurrentUserDesignAction function showContent() { - $notice = $this->user->favoriteNotices(($this->page-1)*NOTICES_PER_PAGE, - NOTICES_PER_PAGE + 1); + $cur = common_current_user(); - if (!$notice) { + if (!empty($cur) && $cur->id == $this->user->id) { + + // Show imported/gateway notices as well as local if + // the user is looking at his own favorites + + $notice = $this->user->favoriteNotices(($this->page-1)*NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1, true); + } else { + $notice = $this->user->favoriteNotices(($this->page-1)*NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1, false); + } + + if (empty($notice)) { $this->serverError(_('Could not retrieve favorite notices.')); return; } |