[wp-trac] Re: [WordPress Trac] #6562: Visual Editor preserves multiple sequential spaces, fouls up shortcode parsing

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 25 01:07:17 GMT 2008


#6562: Visual Editor preserves multiple sequential spaces, fouls up shortcode
parsing
----------------------------+-----------------------------------------------
 Reporter:  markjaquith     |        Owner:  anonymous
     Type:  defect          |       Status:  reopened 
 Priority:  normal          |    Milestone:  2.5.1    
Component:  Administration  |      Version:  2.5      
 Severity:  normal          |   Resolution:           
 Keywords:  has-patch       |  
----------------------------+-----------------------------------------------
Comment (by azaozz):

 I don't think the sequences are generating the proper UTF characters. For
 example the  U+00A0 would be \xC2\xA0
 (http://www.fileformat.info/info/unicode/char/00a0/index.htm), or better
 to type the actual character in the test string.

 The patch does exactly what it says: normalizes the white space characters
 that are valid in HTML but not in PCRE patterns.

 On the other hand since this could be typed by the users, we should
 probably filter it further, something like:
 {{{
 $text = preg_replace("/[^\x20-\x7f\t\n\r]+/", "", $text); // ascii only
 }}}
 This will sanitize the user input and remove the non-compatible white
 space characters too.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6562#comment:11>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list