]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add a check to prevent replying to an unscoped notice
authorEvan Prodromou <evan@status.net>
Mon, 28 Mar 2011 16:01:08 +0000 (12:01 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 28 Mar 2011 16:01:08 +0000 (12:01 -0400)
classes/Notice.php

index 69ed959f3896969dcca2e3e31b1f10a8553db878..3780d52d561d81ebb93768235a50194947f2f8d6 100644 (file)
@@ -351,6 +351,10 @@ class Notice extends Memcached_DataObject
 
         if (!empty($notice->reply_to)) {
             $reply = Notice::staticGet('id', $notice->reply_to);
+            if (!$reply->inScope($profile)) {
+                throw new ClientException(sprintf(_("%s has no access to notice %d"),
+                                                  $profile->nickname, $reply->id), 403);
+            }
             $notice->conversation = $reply->conversation;
         }