[wp-trac] Re: [WordPress Trac] #3670: Removing CDATA close tag (
]]> ) unbalances the CDATA block
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 4 22:12:55 GMT 2008
#3670: Removing CDATA close tag ( ]]> ) unbalances the CDATA block
--------------------------------------------------+-------------------------
Reporter: scenic | Owner: andy
Type: defect | Status: new
Priority: normal | Milestone: 2.5.1
Component: Template | Version: 2.1
Severity: major | Resolution:
Keywords: has-patch needs-testing dev-feedback |
--------------------------------------------------+-------------------------
Changes (by AaronCampbell):
* keywords: dev-feedback => has-patch needs-testing dev-feedback
* priority: low => normal
* component: Administration => Template
* severity: normal => major
* milestone: 2.6 => 2.5.1
Comment:
This ticket has sat here forever with nothing getting done, so I added a
patch to get the ball rolling. The patch will fix two problems. It will
fix one expressed above by only replacing {{{]]>}}} with {{{]]>}}} when
it is processing a feed.
There was another problem because we so often use:
{{{
//<![CDATA[
alert('test');
//]]>
}}}
and {{{strip_tags()}}} leaves the leading // there, which looks ugly in
the feeds as well. I added a simple statement in two places to handle
that:
{{{$text = preg_replace('|//\s*<!\[CDATA\[|', '<![CDATA[', $text);}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/3670#comment:17>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list