Changeset 12985
- Timestamp:
- 02/06/2010 07:19:25 AM (16 years ago)
- Location:
- trunk/wp-admin/import
- Files:
-
- 3 edited
-
blogware.php (modified) (4 diffs)
-
rss.php (modified) (3 diffs)
-
wordpress.php (modified) (3 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 -
trunk/wp-admin/import/rss.php
r12789 r12985 29 29 function footer() { 30 30 echo '</div>'; 31 }32 33 function unhtmlentities($string) { // From php.net for < 4.3 compat34 $trans_tbl = get_html_translation_table(HTML_ENTITIES);35 $trans_tbl = array_flip($trans_tbl);36 return strtr($string, $trans_tbl);37 31 } 38 32 … … 88 82 $cat_index = 0; 89 83 foreach ($categories as $category) { 90 $categories[$cat_index] = $wpdb->escape( $this->unhtmlentities($category));84 $categories[$cat_index] = $wpdb->escape( html_entity_decode( $category ) ); 91 85 $cat_index++; 92 86 } … … 104 98 // This is for feeds that put content in description 105 99 preg_match('|<description>(.*?)</description>|is', $post, $post_content); 106 $post_content = $wpdb->escape( $this->unhtmlentities(trim($post_content[1])));100 $post_content = $wpdb->escape( html_entity_decode( trim( $post_content[1] ) ) ); 107 101 } 108 102 -
trunk/wp-admin/import/wordpress.php
r12657 r12985 42 42 function footer() { 43 43 echo '</div>'; 44 }45 46 function unhtmlentities($string) { // From php.net for < 4.3 compat47 $trans_tbl = get_html_translation_table(HTML_ENTITIES);48 $trans_tbl = array_flip($trans_tbl);49 return strtr($string, $trans_tbl);50 44 } 51 45 … … 451 445 $tag_index = 0; 452 446 foreach ($tags as $tag) { 453 $tags[$tag_index] = $wpdb->escape( $this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $tag)));447 $tags[$tag_index] = $wpdb->escape( html_entity_decode( str_replace(array( '<![CDATA[', ']]>' ), '', $tag ) ) ); 454 448 $tag_index++; 455 449 } … … 460 454 $cat_index = 0; 461 455 foreach ($categories as $category) { 462 $categories[$cat_index] = $wpdb->escape( $this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $category)));456 $categories[$cat_index] = $wpdb->escape( html_entity_decode( str_replace( array( '<![CDATA[', ']]>' ), '', $category ) ) ); 463 457 $cat_index++; 464 458 }
Note: See TracChangeset
for help on using the changeset viewer.