From 08b0eb170badbb1f518e656aa868156fd01154d3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 8 Nov 2006 01:12:41 +0000 Subject: [PATCH] Fix amp handling. Props skeltoac. fixes #3328 git-svn-id: https://develop.svn.wordpress.org/trunk@4451 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 2a22eb93e7..747f0099da 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -109,7 +109,9 @@ function seems_utf8($Str) { # by bmorel at ssi dot fr function wp_specialchars( $text, $quotes = 0 ) { // Like htmlspecialchars except don't double-encode HTML entities - $text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/', '&$1', $text); + $text = str_replace('&&', '&&', $text); + $text = str_replace('&&', '&&', $text); + $text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&$1', $text); $text = str_replace('<', '<', $text); $text = str_replace('>', '>', $text); if ( 'double' === $quotes ) {