Page is a not externally linkable
coopster - 9:21 pm on Apr 16, 2008 (gmt 0)
I am assuming the person that wrote that was referring to whitespace as defined in the RFC, linear white space (LWS) which is carriage return, linefeed, space, and horizontal-tab. For the sake of this discussion, consider the response as being either the In regards to server-side technology, yes, I imagine either a failing interpreter or a poor developer could throw you into quirks mode unexpectedly. I have never seen the PHP interpreter do this on it's own, but I as the programmer can indeed invoke quirks mode by inserting those characters in the message body. Take the following example, append this to the front of your example, SuzyUK, and save the file with a .php extension so your server parses it as PHP:
Me neither.. I just read somewhere today that whitespace won't trigger Quirks if indeed it is really whitespace - I don't understand that? CR = <US-ASCII CR, carriage return (13)>
LF = <US-ASCII LF, linefeed (10)>
SP = <US-ASCII SP, space (32)>
HT = <US-ASCII HT, horizontal-tab (9)>
I can have any of these whitespace characters ahead of my DOCTYPE and remain in standards mode with both MSIE6 and Mozilla. Perhaps they are referring to the other "whitespace" characters, such as control characters? I just inserted a <US-ASCII BS, backspace (8)> character before the DOCTYPE and it threw MSIE into quirks mode. Mozilla remained in standards mode. I tried the ESC character as well with the same results. <?php print str_repeat [php.net]("\r\n", 10); ?>
<p>Which Mode?</p>
<h2>
<script type="text/javascript">
mode = document.compatMode;
document.write(mode);
</script>
</h2>
<hr>
<ul><li>BackCompat = Quirks Mode</li>
<li>CSS1Compat = Standards Compliance Mode</li></ul>
That single line of PHP will write out 10 CRLF and neither browser will go into quirks mode. However, replace that line of PHP with this line which prints out a single backspace character and MSIE6 will indeed go into quirks mode. <?php print chr [php.net](27); ?>
To summarize, I think malformed header fields would cause issues well before quirks mode might be invoked. I don't have the time to test the theory right now but if somebody else could ...