[stable25] fix(dav): Always respond custom error page on exceptions#48304
[stable25] fix(dav): Always respond custom error page on exceptions#48304
Conversation
b407afd to
71582d2
Compare
71582d2 to
0d488df
Compare
20d9af7 to
c513c09
Compare
| 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
| } 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
8c3e687
Compare
8c3e687 to
972fcb2
Compare
d8e966a to
a7d821d
Compare
Signed-off-by: Louis Chemineau <[email protected]>
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]>
…utput Signed-off-by: Louis Chemineau <[email protected]>
Signed-off-by: Louis Chemineau <[email protected]>
Signed-off-by: Louis Chemineau <[email protected]>
15b695d to
fc6ab73
Compare
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.