[wp-trac] [WordPress Trac] #17648: post titles with < followed directly by words truncates title and permalink

WordPress Trac noreply at wordpress.org
Wed Oct 31 00:44:14 UTC 2012


#17648: post titles with < followed directly by words truncates title and permalink
--------------------------+------------------------------
 Reporter:  haveboard     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Permalinks    |     Version:  3.1.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------
Changes (by wonderboymusic):

 * keywords:  needs-patch => has-patch


Comment:

 {{{sanitize_title_with_dashes()}}} calls {{{strip_tags()}}} which is a
 dumb function. From php.net:

     ''Because strip_tags() does not actually validate the HTML, partial,
 or broken tags can result in the removal of more text/data than
 expected.''

 {{{wp_filter_nohtml_kses()}}} does the trick. With my patch, "test <post
 goes <em>here</em><br /><this is some more" produces this as a post_name:

 {{{
 test-post-goes-herethis-is-some-more
 }}}

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


More information about the wp-trac mailing list