Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

artonge and others added 4 commits September 23, 2024 15:23
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 <[email protected]>
Signed-off-by: Louis Chemineau <[email protected]>
@artonge artonge added the 2. developing Work in progress label Sep 23, 2024
@artonge artonge self-assigned this Sep 23, 2024
@artonge artonge changed the title Artonge/backport/stable27/47770 [stable27] fix(dav): Always respond custom error page on exceptions Sep 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 Note

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 Note

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 Note

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 Note

The method OC\Server::getConfig has been marked as deprecated
@artonge
Copy link
Contributor Author

artonge commented Sep 23, 2024

/backport! to stable26

@artonge
Copy link
Contributor Author

artonge commented Sep 23, 2024

/backport! to stable25

@artonge artonge 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
@artonge artonge force-pushed the artonge/backport/stable27/47770 branch from a77cf76 to 6b026d8 Compare October 1, 2024 08:27
@sorbaugh sorbaugh merged commit f77dd11 into stable27 Oct 1, 2024
38 of 40 checks passed
@sorbaugh sorbaugh deleted the artonge/backport/stable27/47770 branch October 1, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: dav php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants