-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[stable25] fix(dav): Always respond custom error page on exceptions #48304
Conversation
b407afd
to
71582d2
Compare
71582d2
to
0d488df
Compare
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
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 Note
$httpCode = 500; | ||
$headers = []; | ||
} | ||
$this->server->httpResponse->addHeaders($headers); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch Note
$httpCode = 500; | ||
$headers = []; | ||
} | ||
$this->server->httpResponse->addHeaders($headers); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
} else { | ||
$templateName = 'xml_exception'; | ||
$renderAs = null; | ||
$this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch Note
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
public function sendResponse() { |
Check notice
Code scanning / Psalm
MissingReturnType Note
* @codeCoverageIgnore | ||
*/ | ||
public function sendResponse() { | ||
$this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch Note
* @codeCoverageIgnore | ||
*/ | ||
public function sendResponse() { | ||
$this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
* @codeCoverageIgnore | ||
*/ | ||
public function sendResponse() { | ||
$this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch Note
* @codeCoverageIgnore | ||
*/ | ||
public function sendResponse() { | ||
$this->server->sapi->sendResponse($this->server->httpResponse); |
Check notice
Code scanning / Psalm
PossiblyNullArgument Note
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.