-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable28] fix(dav): Always respond custom error page on exceptions #47785
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
Conversation
26df2fe to
d25d8cc
Compare
| } else { | ||
| $templateName = 'xml_exception'; | ||
| $renderAs = null; | ||
| $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); |
Check notice
Code scanning / Psalm
PossiblyNullPropertyFetch
| } else { | ||
| $templateName = 'xml_exception'; | ||
| $renderAs = null; | ||
| $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); |
Check notice
Code scanning / Psalm
PossiblyNullReference
| $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
| 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
susnux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible please directly include the fix for invalid PHP short tags, otherwise OCS / WebDAV errors are broken:
#47805
Otherwise dismiss this if you prefer to handle separate PRs
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]>
785582a to
414a66e
Compare
Backport of #47770
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.