WordPress.org

Make WordPress Core

Ticket #3328: ampamp.diff

File ampamp.diff, 701 bytes (added by andy, 12 years ago)
  • wp-includes/formatting.php

     
    109109
    110110function wp_specialchars( $text, $quotes = 0 ) {
    111111        // Like htmlspecialchars except don't double-encode HTML entities
    112         $text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/', '&$1', $text);
     112        $text = str_replace('&&', '&&', $text);
     113        $text = str_replace('&&', '&&', $text);
     114        $text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&$1', $text);
    113115        $text = str_replace('<', '&lt;', $text);
    114116        $text = str_replace('>', '&gt;', $text);
    115117        if ( 'double' === $quotes ) {