WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#17776 closed defect (bug) (duplicate)

Blogger Importer extra > in title and body

Reported by: Workshopshed Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1.4
Component: Import Keywords:
Focuses: Cc:

Description

The title and the body of the imports have an extra > present prefixed.

Blogger Importer version 0.3 on PHP 5.3.2.
N.B. Problem does not exist for PHP 5.2.2

Problem has been traced to the CData function im the XML parser which is treating an array like a string which acts differently in 5.3.

The correct solution is not to change end element but to add an extra "if" into the cdata function as follows

function cdata($parser, $data) {
		#print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
		if (!empty($this->in_content)) {
			// handle self-closing tags (case: text node found, need to close element started)
            // AGC:Fix 2011-04-08 Error with StrPos expects first parameter to be a string not an array
            if (count($this->in_content) > 1) {
    			if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) {
    				array_push($this->in_content, ">");
    			}
            }
			array_push($this->in_content, $this->xml_escape($data));
		}
	}

See:
http://wordpress.org/support/topic/plugin-blogger-importer-extra-s

http://wordpress.org/support/topic/blogger-to-wordpress-formatting-problem

Change History (4)

comment:1 @Workshopshed4 years ago

Just checked, this problem also exists in Blogger importer 0.4

comment:2 @Otto424 years ago

Dupe. #14525

Also, new branch will fix the problem.

comment:3 @Otto424 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

comment:4 @ocean904 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.