Make WordPress Core

Changeset 5734


Ignore:
Timestamp:
06/19/2007 10:46:55 PM (17 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

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

    r5709 r5734  
    11061106function js_escape($text) {
    11071107    $safe_text = wp_specialchars($text, 'double');
    1108     $safe_text = str_replace(''', "'", $safe_text);
     1108    $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
    11091109    $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
    11101110    return apply_filters('js_escape', $safe_text, $text);
Note: See TracChangeset for help on using the changeset viewer.