[wp-trac] [WordPress Trac] #22286: Enhancing backslashit performance

WordPress Trac noreply at wordpress.org
Wed Nov 21 03:43:15 UTC 2012


#22286: Enhancing backslashit performance
----------------------------------------+-----------------------------
 Reporter:  jbutkus                     |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Formatting                  |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch commit 3.6-early  |
----------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 {{{
 // Do not use [A..z], as it would also add backslashes to intermediate
 // characters (namely: '[', '\', ']', '^', '_', '`').
 $string = addcslashes(
         $string,
         'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
 );
 }}}
 Seems that `'A..Za..z'` can be used instead of full enumeration without
 the mentioned side effect. [attachment:22286.diff] changes that.

 Moved the unit test into a separate patch: [attachment:22286.test.diff].

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


More information about the wp-trac mailing list