Hi cPanel Support,
I would like to add to this issue as it can be pretty nasty and I am not sure the examples in this thread convey the full potential negative impact of this feature/bug.
This replacement of meta tags seems to take place in PHP files as well as HTML files and this is one place where things can get particularly messy. Consider the following real-world example:
<meta charset="<?php bloginfo( 'charset' ); ?>" />
In the cPanel file editor it is automatically replaced with this:
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
You may have noticed that the substituted PHP code will now generate invalid HTML resulting in the WordPress charset not being inserted and the original self-closing portion of the tag being left as detritus in the file. The leftover remnants of the self-closing meta tag are interpreted by some browsers (such as Chrome) as text to be printed and they also trigger the immediate closure of the head tag at that point in the file. Now, it is true that self-closing is not required for void element tags and ideally would not be used but to the best of my knowledge it is permissible under the HTML5 standards and is used by many developers in a wide range of free and commercial products. Editing any of these files containing a meta tag in the cPanel editor will cause them to generate invalid HTML. It is worth noting that this also affects PHP files that generate XHTML where the self-closing of void element tags such as the meta tag IS required by the standard.
I would also like to note that this code modification by the editor takes place at the time of opening so you never even see the actual file contents in the editor and there is no indication to the user that the file has been changed upon opening. The changes are of course not written to disk until the file is saved in the editor but the in-memory editor version of the file is modified at the time of opening.
Now I am not trying to cast aspersions; cPanel is an amazing product and cPanel support is exemplary. However, to give my two-cents on this issue: I would much rather not have an inbuilt editor at all than have one that changes the contents of a file I am editing, especially when it does so without notifying me and doubly so when it introduces serious bugs into portions of code that I didn't even touch. I am not sure why these modifications take place and I am sure there is a good reason but as an outsider, it seems like a bad idea for an editor to make silent changes to file contents under any circumstances.
To be thorough in my testing, I tried switching to the legacy editor by pressing the "Use legacy editor" button and then hitting the "Re-open" button to be sure, but this resulted in the same substitution behaviour as the new editor.
Cheers, and keep up the good work.