Skip to content

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

Merged
sorbaugh merged 5 commits into
stable26from
backport/48297/stable26
Oct 1, 2024
Merged

[stable26] fix(dav): Always respond custom error page on exceptions#48303
sorbaugh merged 5 commits into
stable26from
backport/48297/stable26

Conversation

@backportbot

@backportbotbackportbotBot commented Sep 23, 2024

Copy link
Copy Markdown

Backport of #48297

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot
backportbotBot requested a review from artongeSeptember 23, 2024 16:11
@backportbotbackportbotBot added the 3. to review Waiting for reviews label Sep 23, 2024
@artongeartonge changed the title [stable26] [stable27] fix(dav): Always respond custom error page on exceptions[stable26] fix(dav): Always respond custom error page on exceptionsSep 23, 2024
@artonge
artonge marked this pull request as ready for review September 24, 2024 08:16
@artonge
artongeforce-pushed the backport/48297/stable26 branch from 81dac53 to 8eacf8dCompareSeptember 24, 2024 08:19
} 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
artongeforce-pushed the backport/48297/stable26 branch from 8eacf8d to abca7fbCompareSeptember 24, 2024 09:33
@artonge
artongeforce-pushed the backport/48297/stable26 branch from abca7fb to b154be9CompareSeptember 25, 2024 16:04
@artongeartonge added bug feature: dav php Pull requests that update Php code labels Sep 26, 2024
@artonge
artongeforce-pushed the backport/48297/stable26 branch 5 times, most recently from d4679a1 to b33694aCompareOctober 1, 2024 10:09
artongeand others added 5 commits October 1, 2024 14:46
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>
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
artongeforce-pushed the backport/48297/stable26 branch from b33694a to 2a10014CompareOctober 1, 2024 12:46
@sorbaugh
sorbaugh merged commit 218c76b into stable26Oct 1, 2024
@sorbaugh
sorbaugh deleted the backport/48297/stable26 branch October 1, 2024 15:55
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.

6 participants

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