Skip to content

Fix parameter overwriting template file #646

Description

@juliusknorr

From nextcloud/server#14330 (comment)

@juliushaertl @rullzer mind to have a look? This is a regression from nextcloud/server#8051

If you try to return an exception like in the DocumentController you override the name of the template with the error class.

$params = [
'remoteAddr' => $this->request->getRemoteAddress(),
'requestID' => $this->request->getId(),
'debugMode' => $this->settings->getSystemValue('debug'),
'errorClass' => get_class($e),
'errorCode' => $e->getCode(),
'errorMsg' => $e->getMessage(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTraceAsString()
];
return new TemplateResponse('core', 'exception', $params, 'guest');

https://github.com/nextcloud/server/blob/3f4941e48aead48bacc7077e2819b492d1394778/lib/private/Template/Base.php#L162-L188

Screenshot from 2019-03-25 19-36-52
Screenshot from 2019-03-25 19-37-09

If we pass file as additionalParams the value $file (which should be the name of the template) is overriden. We try to use CurlFactory as error template than.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developWaiting for a developerbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions