[wp-trac] [WordPress Trac] #17776: Blogger Importer extra > in title and body

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 12 19:39:15 UTC 2011


#17776: Blogger Importer extra > in title and body
--------------------------+-----------------------------
 Reporter:  Workshopshed  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Import        |    Version:  3.1.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 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

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17776>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list