Fix amp handling. Props skeltoac. fixes #3328

git-svn-id: https://develop.svn.wordpress.org/trunk@4451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-11-08 01:12:41 +00:00
parent 04c0b4f99d
commit 08b0eb170b
1 changed files with 3 additions and 1 deletions

View File

@ -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('<', '&lt;', $text);
$text = str_replace('>', '&gt;', $text);
if ( 'double' === $quotes ) {