Fix single quote problems in LJ importer, props beaulebens, fixes #8999

git-svn-id: https://develop.svn.wordpress.org/trunk@10492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-02-04 00:04:29 +00:00
parent 9599eaa2ca
commit dfd3ae6068
1 changed files with 2 additions and 7 deletions

View File

@ -234,12 +234,6 @@ class LJ_API_Import {
<?php
}
function unhtmlentities($string) { // From php.net for < 4.3 compat
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}
function import_posts() {
$total = (int) get_option( 'ljapi_total' );
$count = (int) get_option( 'ljapi_count' );
@ -583,7 +577,8 @@ class LJ_API_Import {
// Get the body and HTMLize it
preg_match( '|<body>(.*)</body>|is', $comment, $matches );
$comment_content = !empty( $comment_subject ) ? $comment_subject . "\n\n" . $matches[1] : $matches[1];
$comment_content = $this->unhtmlentities( $comment_content );
$comment_content = html_entity_decode( $comment_content );
$comment_content = str_replace( '&apos;', "'", $comment_content );
$comment_content = wpautop( $comment_content );
$comment_content = str_replace( '<br>', '<br />', $comment_content );
$comment_content = str_replace( '<hr>', '<hr />', $comment_content );