[wp-trac] [WordPress Trac] #4613: Entities HTML causes problems in WXR Import !

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 11 15:13:50 GMT 2007


#4613: Entities HTML causes problems in WXR Import !
----------------------------+-----------------------------------------------
 Reporter:  momo360modena   |       Owner:  anonymous       
     Type:  defect          |      Status:  new             
 Priority:  normal          |   Milestone:  2.2.2           
Component:  Administration  |     Version:  2.2.1           
 Severity:  major           |    Keywords:  import, wsr, xml
----------------------------+-----------------------------------------------
 I have a problem with importer.

 If categories have entites HTML, as "&" or "&" in name
 During importing, Importer create "a zillion duplicate categories"

 Because, in importer you clean title with
 {{{
 $categories[$cat_index] =
 $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[',
 ']]>'), '', $category)));
 }}}

 And after the query return false...

 Example : In DB you have
 Category NAME : 'Toto &amp; Blurps'
 In Query (l.319) : 'Toto & Blurps'

 {{{
 "SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$category'"
 }}}

 See patch for one possible solution.
 See XML for an example of the problem...

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


More information about the wp-trac mailing list