WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/21/2009 06:51:48 PM (11 years ago)
Author:
ryan
Message:

Use preg_replace_callback instead of preg_replace with eval. Props beaulebens. see #8689 for 2.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-includes/formatting.php

    r10391 r10392  
    13061306    } else {
    13071307        $subject = str_replace('_', ' ', $matches[2]);
    1308         /** @todo use preg_replace_callback() */
    1309         $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
     1308        $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject);
    13101309        return $subject;
    13111310    }
Note: See TracChangeset for help on using the changeset viewer.