From a5fe68e002632c190ffbd85167671ed4d4961135 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 21 Jun 2007 16:41:02 +0000 Subject: WP Merge to WP 2.2.1 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1005 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/formatting.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'wp-includes/formatting.php') 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 ); +} + ?> -- cgit