PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_HTMLSax » Bug #6742

Error handling <![if tags

Details

Submitted2006-02-10 10:05 UTC
Fromjon at jonemerson dot net
StatusOpen
PackageXML_HTMLSax
PHP Version4.4.2
OSWindows
Roadmaps(Not assigned)

Comments

[2006-02-10 10:05 UTC] jon at jonemerson dot net

Description:
------------
In Yahoo!'s search results, and on many other pages, there's a tag <![if !IE]>. If XML_HTMLSax runs across this tag, it assumes it's a CDATA tag and looks for it to be terminated by ]]>. This is incorrect. Instead it should not make this assumption and should look for a termination of ]>.

To fix this bug, change lines 224 through 232 (or so) of XML_HTMLSax_States.php to:

} else if ( $char == '[') {
$text = $context->scanUntilString(']>');
$context->IgnoreCharacter();
} else ...

This will take away the CDATA assumption and look for ]> instead.