]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Network wide public feed auth check fix
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 29 Jan 2015 22:30:13 +0000 (23:30 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 29 Jan 2015 22:30:13 +0000 (23:30 +0100)
actions/apitimelinenetworkpublic.php
actions/networkpublic.php

index a2039a3761b41924c02bac92be646b08c7460e73..957842600abd8ff8c238450d2c3ec84a1ed156a6 100644 (file)
@@ -11,6 +11,9 @@ class ApiTimelineNetworkPublicAction extends ApiTimelinePublicAction
 
     protected function getStream()
     {
+        if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
+            $this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
+        }
         return new NetworkPublicNoticeStream($this->scoped);
     }
 }
index 0948c35399be33100c45bda192a54aae8bfba331..79e642b773e0a13ef636a0fbe4e7fdf927538d09 100644 (file)
@@ -7,7 +7,7 @@ class NetworkpublicAction extends PublicAction
     protected function streamPrepare()
     {
         if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
-            $this->serverError(_('Network wide public feed is not permitted without authorization'), 403);
+            $this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
         }
         if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
             $this->stream = new NetworkPublicNoticeStream($this->scoped);