Make WordPress Core

Ticket #8999: single-quotes.diff

File single-quotes.diff, 1.2 KB (added by beaulebens, 16 years ago)

Drops ::unhtmlentities() entirely and uses html_entity_decode() to avoid single quote problems. Tested in FF and IE6 and looks good.

  • wp-admin/import/livejournal.php

     
    234234                <?php
    235235        }
    236236       
    237         function unhtmlentities($string) { // From php.net for < 4.3 compat
    238                 $trans_tbl = get_html_translation_table(HTML_ENTITIES);
    239                 $trans_tbl = array_flip($trans_tbl);
    240                 return strtr($string, $trans_tbl);
    241         }
    242        
    243237        function import_posts() {
    244238                $total           = (int) get_option( 'ljapi_total' );
    245239                $count           = (int) get_option( 'ljapi_count' );
     
    583577                // Get the body and HTMLize it
    584578                preg_match( '|<body>(.*)</body>|is', $comment, $matches );
    585579                $comment_content = !empty( $comment_subject ) ? $comment_subject . "\n\n" . $matches[1] : $matches[1];
    586                 $comment_content = $this->unhtmlentities( $comment_content );
     580                $comment_content = html_entity_decode( $comment_content );
     581                $comment_content = str_replace( '&apos;', "'", $comment_content );
    587582                $comment_content = wpautop( $comment_content );
    588583                $comment_content = str_replace( '<br>', '<br />', $comment_content );
    589584                $comment_content = str_replace( '<hr>', '<hr />', $comment_content );