Bugzilla – Bug 103
Make the feed sniffer skip BOMs.
Last modified: 2008-03-06 12:44:14 CET
Index: source =================================================================== --- source (revision 1281) +++ source (revision 1282) @@ -28085,7 +28085,13 @@ <li><p>Initialise <var title="">pos</var> to 0.</p></li> - <li><p>Examine <span><var title="">s</var>[<var + <li><p>If <span><var title="">s</var>[0]</span> is 0xEF, <span><var + title="">s</var>[1]</span> is 0xBB, and <span><var + title="">s</var>[2]</span> is 0xBF, then set <var + title="">pos</var> to 3. (This skips over a leading UTF-8 BOM, if + any.)</p></li> + + <li><p><i>Loop start:</i> Examine <span><var title="">s</var>[<var title="">pos</var>]</span>.</p> <dl class="switch"> @@ -28119,12 +28125,12 @@ title="">pos</var>+2</span> in <var title="">s</var> are exactly equal to 0x2D, 0x2D, 0x3E respectively (ASCII for "<code title="">--></code>"), then increase <var title="">pos</var> - by 3 and jump back to the previous step (step 5) in the overall - algorithm in this section.</li> + by 3 and jump back to the previous step (the step labelled + <i>loop start</i>) in the overall algorithm in this section.</li> <li>Otherwise, increase <var title="">pos</var> by 1.</li> - <li>Otherwise, return to step 2 in these substeps.</li> + <li>Return to step 2 in these substeps.</li> </ol> @@ -28137,7 +28143,7 @@ <!-- this skips past a DOCTYPE if there is one. It is brain-dead because we don't have to be clever to parse the Atom and RSS x.y DOCTYPEs, as they don't do anything clever like have internal - subsets of quoted ">" characters. If this fails, then that's ok, + subsets or quoted ">" characters. If this fails, then that's ok, we'll treat it as HTML which is fine since we know it's not a feed in that case. --> @@ -28147,8 +28153,8 @@ <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> equal 0x3E, then increase <var - title="">pos</var> by 1 and jump back to step 5 in the overall - algorithm in this section.</li> + title="">pos</var> by 1 and jump back to the step labelled + <i>loop start</i> in the overall algorithm in this section.</li> <li>Otherwise, return to step 1 in these substeps.</li> @@ -28167,8 +28173,9 @@ <li>If <span><var title="">s</var>[<var title="">pos</var>]</span> and <span><var title="">s</var>[<var title="">pos</var>+1]</span> equal 0x3F and 0x3E respectively, - then increase <var title="">pos</var> by 1 and jump back to - step 5 in the overall algorithm in this section.</li> + then increase <var title="">pos</var> by 1 and jump back to the + step labelled <i>loop start</i> in the overall algorithm in this + section.</li> <li>Otherwise, return to step 1 in these substeps.</li>
No bug yet.