From 8a4019bb28db79844c708128b066ef27c3d9541c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 15 Sep 2009 10:11:59 +0000 Subject: [PATCH] Strip \r when escaping strings for JS, props nbachiyski, fixes #7041 git-svn-id: https://develop.svn.wordpress.org/trunk@11935 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 77f3ffa629..a88beb68e7 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2199,8 +2199,10 @@ function htmlentities2($myHTML) { } /** - * Escape single quotes, specialchar double quotes, and fix line endings. + * Escape single quotes, htmlspecialchar " < > &, and fix line endings. * + * Escapes text strings for echoing in JS, both inline (for example in onclick="...") + * and inside