Skip to content

[stable30] fix(dav): Always respond custom error page on exceptions - #47787

Merged
AndyScherzinger merged 1 commit into
stable30from
backport/47770/stable30
Sep 5, 2024
Merged

[stable30] fix(dav): Always respond custom error page on exceptions#47787
AndyScherzinger merged 1 commit into
stable30from
backport/47770/stable30

Conversation

@backportbot

Copy link
Copy Markdown

Backport of PR #47770

Signed-off-by: Louis Chemineau <louis@chmn.me>
@backportbotbackportbotBot added bug 3. to review Waiting for reviews feature: dav php Pull requests that update Php code labels Sep 5, 2024
@backportbotbackportbotBot added this to the Nextcloud 30.0.1 milestone Sep 5, 2024
} else {
$templateName = 'xml_exception';
$renderAs = null;
$this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8');

Check notice

Code scanning / Psalm

PossiblyNullPropertyFetch

Cannot get property on possibly null variable $this->server of type Sabre\DAV\Server|null
} else {
$templateName = 'xml_exception';
$renderAs = null;
$this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8');

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method setHeader on possibly null value
$content = new OC_Template('core', $templateName, 'guest');
$debug = $this->config->getSystemValueBool('debug', false);

$content = new OC_Template('core', $templateName, $renderAs);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 3 of OC_Template::__construct cannot be null, possibly null value provided
if (BrowserErrorPagePlugin::isBrowserRequest($request)) {
$this->server->addPlugin(new BrowserErrorPagePlugin());
}
$this->server->addPlugin(new ErrorPagePlugin($this->request, \OC::$server->getConfig()));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getConfig has been marked as deprecated
@AndyScherzinger
AndyScherzinger merged commit cac3305 into stable30Sep 5, 2024
@AndyScherzinger
AndyScherzinger deleted the backport/47770/stable30 branch September 5, 2024 20:29
This was referenced Sep 11, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugfeature: davphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@artonge@provokateurin@github-advanced-security@AndyScherzinger