There are a few issues I have with the output sent from MODx to clients (browsers) not logged into the manager (I don’t use the front end login and probably won’t). None of them are critical, but I find them undesirable, and would like to know if there is a way to parse the final output that MODx decides goes to the connected client before it actually sends it
Specifically:
1. When I enable quickedit, W3C will not validate any document on my MODx site. The opposite is true if I disable quickedit, but I like quickedit, so I don’t want to disable it.
The tag that is triggering errors with the W3C validator is:
I’m guessing the only time this tag is actually used is if I am logged into the manager. Why does this tag appear in the HTML source sent to clients that are
not logged into the manager? I am assuming it’s stored along with the HTML content in MySQL, and then cached after the initial request, but how do I progmatically keep it if logged in and ditch it if not?
2. I modified some settings in the manager - I’m not sure which ones, but I’m almost certain it was manager user settings - and now this appears in the HTML source:
<script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>
I would not like to reveal the vendor of any CMS to nasty little robots that search for vendor specific tags to later apply vendor specific exploits. Yes, I know MODx is tight and no known exploits exist (or do they?). But again, I am assuming this tag is only needed for users that are logged into the manager.
3. Whitespace is not evenly distributed based on tag depth and makes the source illegible for debugging purposes. (Having legible HTML source makes it easier for me to debug the output when needed.)
These are all very little things, but I would like to address them and solve them. I thought it prudent to come here and ask if some method already exists to accomplish what I want: Tidy code with no tags that identify the CMS as a security precaution, and to remove tags that offend the W3C validator,
but only for users
not logged into the manager.
I’m competent with PHP so if some one could point me in the right direction that would be great, and I’ll be glad to contribute any code that results in a solution.
Thanks,
Rich