Make WordPress Core

Changeset 5736


Ignore:
Timestamp:
06/20/2007 07:13:29 PM (18 years ago)
Author:
markjaquith
Message:

js_escape improvements from Alexander Concha. Catches &#39 &#039 ' ' ' ' &#x000027 etc. for 2.0.x

File:
1 edited

Legend:

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

    r5097 r5736  
    10681068function js_escape($text) {
    10691069    $safe_text = wp_specialchars($text, 'double');
    1070     $safe_text = str_replace(''', "'", $safe_text);
     1070    $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
    10711071    $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
    10721072    return apply_filters('js_escape', $safe_text, $text);
Note: See TracChangeset for help on using the changeset viewer.