Opened 10 years ago
Last modified 7 years ago
#38713 new defect (bug)
Shortcodes and utf-8 no-break whitespace (\xc2\xa0)
| Reported by: | mazursv | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Shortcodes | Version: | 4.6.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
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.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
See #35022.