[wp-trac] [WordPress Trac] #16773: Unescaped preg_match breaks with PHP 5.3 Namespaced Widget Classes.

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 6 13:31:25 UTC 2011


#16773: Unescaped preg_match breaks with PHP 5.3 Namespaced Widget Classes.
--------------------------+-----------------------------
 Reporter:  5ubliminal    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  3.1
 Severity:  major         |   Keywords:
--------------------------+-----------------------------
 In file '''/wp-admin/includes/widgets.php''' at line '''118''' in function
 '''next_widget_id_number''' we have:

 {{{
 preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches )
 }}}

 It generates very ugly warnings ''for Namespaced Widget Classes'' as it
 should cuorrectly be:

 {{{
 preg_match( '/' . preg_quote($id_base, '/') . '-([0-9]+)$/', $widget_id,
 $matches )
 }}}

 Thanks.

 '''PS''': ''I think you should do a whole sanity check regarding use of
 Namespaces and Closures. I'm currently switching completely to PHP 5.3
 style and I'll keep you updated if I find other... problems.''

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


More information about the wp-trac mailing list