[wp-trac] [WordPress Trac] #16026: Stop using ereg() and eregi()

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 23 16:47:13 UTC 2011


#16026: Stop using ereg() and eregi()
-------------------------------------------------+-------------------------
 Reporter:  NorwayFun                            |       Owner:  NorwayFun
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  External Libraries                   |  Release
 Severity:  minor                                |     Version:
 Keywords:  has-patch dev-feedback 2nd-opinion   |  Resolution:
  needs-testing                                  |
-------------------------------------------------+-------------------------
Changes (by aaroncampbell):

 * keywords:  needs-patch => has-patch dev-feedback 2nd-opinion needs-
               testing


Comment:

 That patch just converts all ereg to preg (and could use some testing).
 However, it looks like I can improve (or possibly just remove) the
 `glob_regexp()` function.  It's only job is to match a string (case
 insensitive for everything but WIN32).  It seems like:
 {{{
 if ( PHP_OS != 'WIN32' ) {
         return ( strtolower( $pattern ) == strtolower( $probe ) );
 }
 return ( $pattern == $probe );
 }}}

 Since the function is only used once I'd prefer to just put the code
 inline rather than have the function at all, but I wasn't sure how
 important it was to keep around.  Would anyone be trying to use it
 directly?

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


More information about the wp-trac mailing list