diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-06-13 16:18:13 +0200 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-06-13 16:18:13 +0200 |
commit | ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8 (patch) | |
tree | 5134afa67836f0657151a40cfba49c9adf969a50 /plugins/wordpress-importer/parsers.php | |
parent | Update limit-login-attempts, smart-youtube and wp-stats (diff) | |
download | blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.tar.gz blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.tar.bz2 blogs-gentoo-ab05ecf6ac2bdd10e542eff7764de0f02a17f0a8.zip |
New module jetpack, replacement of wp-stats
Update akismet, limit-login-attempts, smart-youtube, wp-importer
Diffstat (limited to 'plugins/wordpress-importer/parsers.php')
-rw-r--r-- | plugins/wordpress-importer/parsers.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/wordpress-importer/parsers.php b/plugins/wordpress-importer/parsers.php index ab4be51a..7bd8ba43 100644 --- a/plugins/wordpress-importer/parsers.php +++ b/plugins/wordpress-importer/parsers.php @@ -462,11 +462,20 @@ class WXR_Parser_Regex { } function get_tag( $string, $tag ) { - global $wpdb; preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return ); if ( isset( $return[1] ) ) { - $return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] ); - $return = $wpdb->escape( trim( $return ) ); + if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) { + if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) { + preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches ); + $return = ''; + foreach( $matches[1] as $match ) + $return .= $match; + } else { + $return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] ); + } + } else { + $return = $return[1]; + } } else { $return = ''; } @@ -527,7 +536,7 @@ class WXR_Parser_Regex { $menu_order = $this->get_tag( $post, 'wp:menu_order' ); $post_type = $this->get_tag( $post, 'wp:post_type' ); $post_password = $this->get_tag( $post, 'wp:post_password' ); - $is_sticky = $this->get_tag( $post, 'wp:is_sticky' ); + $is_sticky = $this->get_tag( $post, 'wp:is_sticky' ); $guid = $this->get_tag( $post, 'guid' ); $post_author = $this->get_tag( $post, 'dc:creator' ); |