Merge pull request #10614 from nextcloud/bugfix/noid/fix_including_invalid_file

Do not use file as template parameter
This commit is contained in:
Roeland Jago Douma 2018-08-09 19:49:47 +02:00 committed by GitHub
commit f630b12fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -12,6 +12,6 @@ if(!isset($_)) {//standalone page is not supported anymore - redirect to /
<ul>
<li class='error'>
<?php p($l->t( 'Access forbidden' )); ?><br>
<p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
<p class='hint'><?php if(isset($_['message'])) p($_['message'])?></p>
</li>
</ul>

View File

@ -249,7 +249,7 @@ class SecurityMiddleware extends Middleware {
$url = $this->urlGenerator->linkToRoute('core.login.showLoginForm', $params);
$response = new RedirectResponse($url);
} else {
$response = new TemplateResponse('core', '403', ['file' => $exception->getMessage()], 'guest');
$response = new TemplateResponse('core', '403', ['message' => $exception->getMessage()], 'guest');
$response->setStatus($exception->getCode());
}
}

View File

@ -568,7 +568,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
'test',
$exception
);
$expected = new TemplateResponse('core', '403', ['file' => $exception->getMessage()], 'guest');
$expected = new TemplateResponse('core', '403', ['message' => $exception->getMessage()], 'guest');
$expected->setStatus($exception->getCode());
$this->assertEquals($expected , $response);
}