plugin updates
This commit is contained in:
@@ -73,7 +73,7 @@ class WXR_Parser_XML {
|
||||
public $base_url;
|
||||
public $base_blog_url;
|
||||
|
||||
function parse( $file ) {
|
||||
public function parse( $file ) {
|
||||
$this->wxr_version = false;
|
||||
$this->in_post = false;
|
||||
$this->cdata = false;
|
||||
@@ -90,9 +90,8 @@ class WXR_Parser_XML {
|
||||
$xml = xml_parser_create( 'UTF-8' );
|
||||
xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
|
||||
xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
|
||||
xml_set_object( $xml, $this );
|
||||
xml_set_character_data_handler( $xml, 'cdata' );
|
||||
xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
|
||||
xml_set_character_data_handler( $xml, array( $this, 'cdata' ) );
|
||||
xml_set_element_handler( $xml, array( $this, 'tag_open' ), array( $this, 'tag_close' ) );
|
||||
|
||||
if ( ! xml_parse( $xml, file_get_contents( $file ), true ) ) {
|
||||
$current_line = xml_get_current_line_number( $xml );
|
||||
@@ -119,7 +118,7 @@ class WXR_Parser_XML {
|
||||
);
|
||||
}
|
||||
|
||||
function tag_open( $parse, $tag, $attr ) {
|
||||
public function tag_open( $parse, $tag, $attr ) {
|
||||
if ( in_array( $tag, $this->wp_tags, true ) ) {
|
||||
$this->in_tag = substr( $tag, 3 );
|
||||
return;
|
||||
@@ -174,7 +173,7 @@ class WXR_Parser_XML {
|
||||
}
|
||||
}
|
||||
|
||||
function cdata( $parser, $cdata ) {
|
||||
public function cdata( $parser, $cdata ) {
|
||||
if ( ! trim( $cdata ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -186,7 +185,7 @@ class WXR_Parser_XML {
|
||||
}
|
||||
}
|
||||
|
||||
function tag_close( $parser, $tag ) {
|
||||
public function tag_close( $parser, $tag ) {
|
||||
switch ( $tag ) {
|
||||
case 'wp:comment':
|
||||
unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data
|
||||
|
||||
Reference in New Issue
Block a user