I use the UK company Krystal for hosting. Their support team gives this lengthy reply:
[Quote]
I have confirmed that an update to Litespeed to the latest version recently is what has caused this issue.
After extensive testing I have found that the way that Litespeed handles backslashes in query strings is the culprit. In a recent update forward slashes were looked at by Litespeed for security hardening and mentioned in their changelog however backslashes aren’t mentioned anywhere but a more general security hardening is. Despite this I have been able to show that URL encoding the backslashes causes the command to succeed.
I will bring this up with Litespeed however it is likely a deliberate change for security reasons. They may provide a workaround as they did with forward slashes however this may not be possible.
That being the case, the best course of action is patching the application to use URL encoded backslashes instead of explicit ones in the query string. This would likely mean contacting the developers of MODX (which I strongly recommend) as well as filing a bug report at their github (I would classify this a bug given it has been working thus far due to more lax querystring parsing by webservers). Alternatively I haven’t dived deep but it could be the resource builder snippet on your website that is causing this and the core MODx files are fine - your developers would have to verify this prior to a bug report.
In the meantime it may be possible to catch the query string being written and doing a search and replace manually before MODX fix this. This can be shown by injecting the following in a developer console for the page:
(function() {
function fixUrl(url) {
if (typeof url === 'string' && url.indexOf('\\') !== -1) {
return url.replace(/\\/g, '%5C');
}
return url;
}
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url) {
arguments[1] = fixUrl(url);
return origOpen.apply(this, arguments);
};
})();
This just replaces \ with the URL encoding of it (%5C) whenever a HTTP request is generated by the page. If added in the console then the refresh icon on the resources is clicked then the pages load in the list.
I have confirmed the above can be added as a plugin bound to the OnManagerPageBeforeRender system event which injects the script immediately into the page. However you will want to review this before activating (it will require a page load after activating).
I hope this helps, please let us know if the plugin I have added “FixBackslashURLEncoding” fixes the issue for you satisfactorily.
[Unquote]
Can anyone suggest how I would add that code as a plugin so that the resource tree becomes visible again? It is way, way beyond my snippet skillset.