[wp-trac] [WordPress Trac] #24225: Improve regular expressions when matching attributes

WordPress Trac noreply at wordpress.org
Mon Apr 29 15:37:56 UTC 2013


#24225: Improve regular expressions when matching attributes
-------------------------+-----------------------------
 Reporter:  kovshenin    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 When working with HTML attributes in various functions we use something
 like `[\'"](.+?)[\'"]` to match the attribute value. Although not used
 much in attribute values, such an approach breaks when a single or double
 quote is intentionally part of the value:

 * `attr="val'ue"`
 * `attr='val"ue'`

 Some of these are new 3.6 functions, mostly around media.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24225>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list