Make WordPress Core


Ignore:
Timestamp:
10/28/2010 07:25:30 AM (14 years ago)
Author:
westi
Message:

Remove create_function usage during preview. See #14424 props ScottMac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r15856 r16034  
    224224    }
    225225    if ( $preview ) // preview fix for javascript bug with foreign languages
    226         $output =   preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);
     226        $output =   preg_replace_callback('/\%u([0-9A-F]{4})/', '__convert_urlencoded_to_entities', $output);
    227227
    228228    return $output;
     229}
     230
     231/**
     232 * Preview fix for javascript bug with foreign languages
     233 *
     234 * @since 3.1.0
     235 * @access private
     236 * @param array $match Match array from preg_replace_callback
     237 * @returns string
     238 */
     239function __convert_urlencoded_to_entities($match) {
     240    return '&#' . base_convert($match[1], 16, 10) . ';';
    229241}
    230242
Note: See TracChangeset for help on using the changeset viewer.