summaryrefslogtreecommitdiffstats
path: root/wp-includes/formatting.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/formatting.php')
-rw-r--r--wp-includes/formatting.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 14eb5b8..b251b6e 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -1103,7 +1103,7 @@ function htmlentities2($myHTML) {
// Escape single quotes, specialchar double quotes, and fix line endings.
function js_escape($text) {
$safe_text = wp_specialchars($text, 'double');
- $safe_text = str_replace(''', "'", $safe_text);
+ $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
$safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
return apply_filters('js_escape', $safe_text, $text);
}
@@ -1118,4 +1118,11 @@ function wp_make_link_relative( $link ) {
return preg_replace('|https?://[^/]+(/.*)|i', '$1', $link );
}
+function wp_parse_str( $string, &$array ) {
+ parse_str( $string, $array );
+ if ( get_magic_quotes_gpc() )
+ $array = stripslashes_deep( $array ); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str
+ $array = apply_filters( 'wp_parse_str', $array );
+}
+
?>