Skip to content

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

Merged
sorbaugh merged 5 commits into
stable27from
artonge/backport/stable27/47770
Oct 1, 2024
Merged

[stable27] fix(dav): Always respond custom error page on exceptions#48297
sorbaugh merged 5 commits into
stable27from
artonge/backport/stable27/47770

Conversation

@artonge

Copy link
Copy Markdown
Collaborator

artongeand others added 4 commits September 23, 2024 15:23
Signed-off-by: Louis Chemineau <louis@chmn.me>
The `<?xml` tag is interpreted as PHP short tags, so this causes errors.
Instead just print that part of the template.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Louis Chemineau <louis@chmn.me>
…utput
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artongeartonge added the 2. developing Work in progress label Sep 23, 2024
@artongeartonge self-assigned this Sep 23, 2024
@artongeartonge changed the title Artonge/backport/stable27/47770[stable27] fix(dav): Always respond custom error page on exceptionsSep 23, 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
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport! to stable26

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport! to stable25

@artongeartonge added 4. to release Ready to be released and/or waiting for tests to finish bug feature: dav php Pull requests that update Php code and removed 2. developing Work in progress labels Sep 26, 2024
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
artongeforce-pushed the artonge/backport/stable27/47770 branch from a77cf76 to 6b026d8CompareOctober 1, 2024 08:27
@sorbaugh
sorbaugh merged commit f77dd11 into stable27Oct 1, 2024
@sorbaugh
sorbaugh deleted the artonge/backport/stable27/47770 branch October 1, 2024 12:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: davphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@artonge@provokateurin@github-advanced-security@come-nc@sorbaugh@susnux