[wp-trac] [WordPress Trac] #38713: Shortcodes and utf-8 no-break whitespace (\xc2\xa0)

WordPress Trac noreply at wordpress.org
Tue Nov 8 16:27:47 UTC 2016


#38713: Shortcodes and utf-8 no-break whitespace (\xc2\xa0)
--------------------------+-----------------------------
 Reporter:  mazursv       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Shortcodes    |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Recently I encountered a problem with one of my posts where Wordpress
 failed to process some of the shortcodes. After hours of digging I found
 that one shortcode contains no-breaking space as separator between
 shortcode name and parameters.

 {{{
 [myshortcode\xc2\xa0param="...
 }}}

 Seems like somebody used external editor to edit post content and then
 pasted it into wp's editor.

 I used following quick fix to permit this problem in future :

 {{{
 add_filter( 'the_content', function( $text ) {
         return str_replace( "\xc2\xa0", " ", $text );
 }, 0, 1);
 }}}

 I think, it's not very good approach. Thus the question to core developers
 to fix this in shortcode parsing functions.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38713>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list