mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +00:00
js_escape() in onclicks. fixes #2851
git-svn-id: https://develop.svn.wordpress.org/trunk@3907 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1044,6 +1044,8 @@ function htmlentities2($myHTML) {
|
||||
// Escape single quotes, specialchar double quotes, and fix line endings.
|
||||
function js_escape($text) {
|
||||
$text = wp_specialchars($text, 'double');
|
||||
return preg_replace("/\r?\n/", "\\n", addslashes($text));
|
||||
$text = str_replace(''', "'", $text);
|
||||
return preg_replace("/\r?\n/", "\\n", addslashes($text));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user