1

This is an extremely peculiar problem that is breaking a website of ours. In Google Chrome, there is a single pre closing tag that incorrectly looks like this: /pre> instead of . You can see it at about line 288 of the source code.

The website has been up for a year now without any code changes and has recently been broken by unknown forces (aren't they always?) but only in Google Chrome browser. The website was thoroughly tested on the then current version of Chrome and performed swell, however the website is now broken not only in the current Google Chrome, but past Google Chrome versions as well (making a Chrome bug unlikely). The page is being parsed on the server by PHP v5.3.8 and the particular markup comes from a straight forward, logic-less bit of code:

    $markup = '';

    foreach($albums AS $album) {
        foreach ($album->videos AS $video) {
            $markup .= '
                    <pre class="video '.$video->id.'">'.$video->url.'</pre>';
        }
    }

    return $markup;

If I echo $markup before it's returned and exit the script before returning $markup, in Chrome I'll see the that last line (same markup from line 288) having a malformed pre closing tag.

                    <pre class="video Woman_v_Workout-FDNY_Training">http://player.vimeo.com/video/41377883</pre>
                    <pre class="video 30_Second_Fitness_Intro-2812">http://player.vimeo.com/video/36457857</pre>
                    <pre class="video Off_the_Beaten_Palate-FoodTravel_Show">http://player.vimeo.com/video/13491373</pre>
                    <pre class="video Make_Up_For_Ever-Blush_Product_Demo">http://player.vimeo.com/video/16980727</pre>
                    <pre class="video Karlssons_Vodka">http://player.vimeo.com/video/34921497</pre>
                    <pre class="video Sage_Spoonfuls">http://player.vimeo.com/video/25146823</pre>
                    <pre class="video iPhone_App_Commercial">http://player.vimeo.com/video/17769191</pre>
                    <pre class="video A_Taste_of_North_Vietnam">http://player.vimeo.com/video/44951293</pre>
                    <pre class="video Aid_for_AIDS_Commercial">http://player.vimeo.com/video/23805118</pre>
                    <pre class="video YPO-WPO_NE_Regional_Conference-31212">http://player.vimeo.com/video/38386105</pre>
                    <pre class="video LonelyGirl48">http://player.vimeo.com/video/13659996</pre>
                    <pre class="video Malibu_Rum-Stickies">http://player.vimeo.com/video/16980262/pre> 

However, If I echo the lines as they go, the offending line prints as expected.

Website can be found here: http://www.oneglassproductions.com All ideas appreciated, I'll be tinkering with it on the production site because the same code base functions properly on other servers. PHP configuration?

EDIT: Thanks to Martin, Adding a space just before the pre closing tag made the closing tag print properly and even now that I've reverted the code to without a space, the closing tag is printing properly (even though the code is identical to when we saw the problem). Still would like to know what might be going on.

4

0 回答 0