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/post-template.php

    r10270 r10392  
    224224    }
    225225    if ( $preview ) // preview fix for javascript bug with foreign languages
    226         $output =   preg_replace('/\%u([0-9A-F]{4,4})/e',   "'&#'.base_convert('\\1',16,10).';'", $output);
     226        $output =   preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);
    227227
    228228    return $output;
Note: See TracChangeset for help on using the changeset viewer.