From: Evan Prodromou Date: Tue, 29 Mar 2011 02:50:45 +0000 (-0400) Subject: disallow access to out-of-scope bookmark X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2856982a1c378ec45722f04aadf37c82b87986cb;p=quix0rs-gnu-social.git disallow access to out-of-scope bookmark --- diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/showbookmark.php index 6bebffb68e..435d85940a 100644 --- a/plugins/Bookmark/showbookmark.php +++ b/plugins/Bookmark/showbookmark.php @@ -76,6 +76,16 @@ class ShowbookmarkAction extends ShownoticeAction throw new ClientException(_('No such bookmark.'), 404); } + if (!empty($cur)) { + $curProfile = $cur->getProfile(); + } else { + $curProfile = null; + } + + if (!$this->notice->inScope($curProfile)) { + throw new ClientException(_('Not available.'), 403); + } + $this->user = User::staticGet('id', $this->bookmark->profile_id); if (empty($this->user)) {