Changeset 12985 for trunk/wp-admin/import/blogware.php
- Timestamp:
- 02/06/2010 07:19:25 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/import/blogware.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/blogware.php
r12752 r12985 28 28 function footer() { 29 29 echo '</div>'; 30 }31 32 function unhtmlentities($string) { // From php.net for < 4.3 compat33 $trans_tbl = get_html_translation_table(HTML_ENTITIES);34 $trans_tbl = array_flip($trans_tbl);35 return strtr($string, $trans_tbl);36 30 } 37 31 … … 79 73 $cat_index = 0; 80 74 foreach ($categories as $category) { 81 $categories[$cat_index] = $wpdb->escape( $this->unhtmlentities($category));75 $categories[$cat_index] = $wpdb->escape( html_entity_decode($category) ); 82 76 $cat_index++; 83 77 } 84 78 85 if ( strcasecmp($post_type, "photo") === 0) {79 if ( strcasecmp($post_type, "photo") === 0 ) { 86 80 preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content); 87 81 $post_content = '<img src="'.trim($post_content[1]).'" />'; 88 $post_content = $this->unhtmlentities($post_content);82 $post_content = html_entity_decode( $post_content ); 89 83 } else { 90 84 preg_match('|<body>(.*?)</body>|is', $post, $post_content); 91 85 $post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1])); 92 $post_content = $this->unhtmlentities($post_content);86 $post_content = html_entity_decode( $post_content ); 93 87 } 94 88 … … 118 112 break; 119 113 } 120 if ( 0 != count($categories))114 if ( 0 != count($categories) ) 121 115 wp_create_categories($categories, $post_id); 122 116 } … … 131 125 preg_match('|<body>(.*?)</body>|is', $comment, $comment_content); 132 126 $comment_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($comment_content[1])); 133 $comment_content = $this->unhtmlentities($comment_content);127 $comment_content = html_entity_decode( $comment_content ); 134 128 135 129 // Clean up content
Note: See TracChangeset
for help on using the changeset viewer.