summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-02-01 10:34:58 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-02-05 20:59:36 +0100
commitd88604015a0828e78a05bf7f1ee80bb78f980dae (patch)
tree8ea665bbc1f6c1c811c4eef7d582705e4efe0420 /lib
parent780e1485c85bf31f1bae9221436798f25810fc72 (diff)
downloadnextcloud-server-d88604015a0828e78a05bf7f1ee80bb78f980dae.tar.gz
nextcloud-server-d88604015a0828e78a05bf7f1ee80bb78f980dae.zip
No need to emit additonalscript event on public pages
There already is a separate event for this. This will make it possible to only inject code with the logged in one on default rendered pages. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php b/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
index de1a02026bf..8e5391b4365 100644
--- a/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
+++ b/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
@@ -27,6 +27,7 @@ namespace OC\AppFramework\Middleware;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Middleware;
+use OCP\AppFramework\PublicShareController;
use OCP\IUserSession;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -42,6 +43,14 @@ class AdditionalScriptsMiddleware extends Middleware {
}
public function afterController($controller, $methodName, Response $response): Response {
+ /*
+ * There is no need to emit these signals on a public share page
+ * There is a separate event for that already
+ */
+ if ($controller instanceof PublicShareController) {
+ return $response;
+ }
+
if ($response instanceof TemplateResponse) {
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS);