WordPress.org

Make WordPress Core

Ticket #4452: 4452-2.diff

File 4452-2.diff, 554 bytes (added by foolswisdom, 11 years ago)

tellyworth found a problem, this fix from tellyworth fixes the problem importing post body

  • wp-admin/import/wordpress.php

     
    3737        function get_tag( $string, $tag ) {
    3838                global $wpdb;
    3939                preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return);
    40                 $return = preg_replace('|<!\[CDATA\[(.*)\]\]>|', '$1', $return[1]);
     40                $return = preg_replace('|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1]);
    4141                $return = $wpdb->escape( trim( $return ) );
    4242                return $return;
    4343        }