Ticket #11144: wordpress.php.2.patch
File wordpress.php.2.patch, 1.4 KB (added by , 13 years ago) |
---|
-
wp-admin/import/wordpress.php
56 56 preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return); 57 57 if ( isset($return[1]) ) { 58 58 $return = preg_replace('|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1]); 59 $return = $wpdb->escape( trim( $return ) ); 59 if ($tag == 'content:encoded') $return = $wpdb->escape( trim( $return, "\t\0\x0B" ) ); 60 else $return = $wpdb->escape( trim( $return ) ); 60 61 } else { 61 62 $return = ''; 62 63 } … … 96 97 97 98 $doing_entry = false; 98 99 $is_wxr_file = false; 100 $in_content_encoded = false; 99 101 100 102 $fp = $this->fopen($this->file, 'r'); 101 103 if ($fp) { 102 104 while ( !$this->feof($fp) ) { 103 $importline = rtrim($this->fgets($fp));105 $importline = $this->fgets($fp); 104 106 107 if ( false !== strpos($importline, '<content:encoded>') ) $in_content_encoded = true; 108 if ( false !== strpos($importline, '</content:encoded>') ) $in_content_encoded = false; 109 if ( $in_content_encoded ) $importline = rtrim($importline, "\n\r\0\x0B"); 110 else $importline = rtrim($importline); 111 105 112 // this doesn't check that the file is perfectly valid but will at least confirm that it's not the wrong format altogether 106 113 if ( !$is_wxr_file && preg_match('|xmlns:wp="http://wordpress[.]org/export/\d+[.]\d+/"|', $importline) ) 107 114 $is_wxr_file = true;