Make WordPress Core


Ignore:
Timestamp:
01/09/2009 07:29:35 PM (16 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r10322 r10339  
    13181318    } else {
    13191319        $subject = str_replace('_', ' ', $matches[2]);
    1320         /** @todo use preg_replace_callback() */
    1321         $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
     1320        $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject);
    13221321        return $subject;
    13231322    }
Note: See TracChangeset for help on using the changeset viewer.