[wp-trac] [WordPress Trac] #10823: Bad handling of ampersand in post titles

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 20 02:41:10 UTC 2011


#10823: Bad handling of ampersand in post titles
---------------------------+--------------------
 Reporter:  Commeuneimage  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.3
Component:  Formatting     |     Version:  2.8.4
 Severity:  minor          |  Resolution:
 Keywords:  has-patch      |
---------------------------+--------------------

Comment (by azaozz):

 Replying to [comment:5 pufuwozu]:
 > {{{
 > $title = preg_replace('/&[#a-z0-9]+?;/', '', $title); // kill entities
 > }}}

 That looks good except the "?" is not needed. Also we can specify the
 length of that string:

 {{{
 $title = preg_replace('/&[#a-z0-9]{2,6};/', '', $title);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10823#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list