Uh oh!
There was an error while loading. Please reload this page.
[stable25] fix(dav): Always respond custom error page on exceptions - #48304
Conversation
b407afd to
71582d2Compare71582d2 to
0d488dfCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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
20d9af7 to
c513c09Compare| public function logException(\Throwable $ex): void { | ||
| if ($ex instanceof Exception) { | ||
| $httpCode = $ex->getHTTPCode(); | ||
| $headers = $ex->getHTTPHeaders($this->server); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
| $httpCode = 500; | ||
| $headers = []; | ||
| } | ||
| $this->server->httpResponse->addHeaders($headers); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch
| $httpCode = 500; | ||
| $headers = []; | ||
| } | ||
| $this->server->httpResponse->addHeaders($headers); |
Check notice
Code scanning / Psalm
PossiblyNullReference
Uh oh!
There was an error while loading. Please reload this page.
| } else { | ||
| $templateName = 'xml_exception'; | ||
| $renderAs = null; | ||
| $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch
| /** | ||
| * @codeCoverageIgnore | ||
| */ | ||
| public function sendResponse() { |
Check notice
Code scanning / Psalm
MissingReturnType
| * @codeCoverageIgnore | ||
| */ | ||
| public function sendResponse() { | ||
| $this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch
| * @codeCoverageIgnore | ||
| */ | ||
| public function sendResponse() { | ||
| $this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullReference
| * @codeCoverageIgnore | ||
| */ | ||
| public function sendResponse() { | ||
| $this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch
| * @codeCoverageIgnore | ||
| */ | ||
| public function sendResponse() { | ||
| $this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
c513c09 to
8c3e687Compare8c3e687 to
972fcb2Compared8e966a to
a7d821dCompareSigned-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>
…utput Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
15b695d to
fc6ab73Compare
Backport of #48297
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.