Make WordPress Core


Ignore:
Timestamp:
02/06/2010 07:19:25 AM (16 years ago)
Author:
dd32
Message:

Remove < PHP 4.3 compat functions from importers. Props nacin. Fixes #11636

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/blogware.php

    r12752 r12985  
    2828    function footer() {
    2929        echo '</div>';
    30     }
    31 
    32     function unhtmlentities($string) { // From php.net for < 4.3 compat
    33         $trans_tbl = get_html_translation_table(HTML_ENTITIES);
    34         $trans_tbl = array_flip($trans_tbl);
    35         return strtr($string, $trans_tbl);
    3630    }
    3731
     
    7973            $cat_index = 0;
    8074            foreach ($categories as $category) {
    81                 $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category));
     75                $categories[$cat_index] = $wpdb->escape( html_entity_decode($category) );
    8276                $cat_index++;
    8377            }
    8478
    85             if (strcasecmp($post_type, "photo") === 0) {
     79            if ( strcasecmp($post_type, "photo") === 0 ) {
    8680                preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content);
    8781                $post_content = '<img src="'.trim($post_content[1]).'" />';
    88                 $post_content = $this->unhtmlentities($post_content);
     82                $post_content = html_entity_decode( $post_content );
    8983            } else {
    9084                preg_match('|<body>(.*?)</body>|is', $post, $post_content);
    9185                $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 );
    9387            }
    9488
     
    118112                    break;
    119113                }
    120                 if (0 != count($categories))
     114                if ( 0 != count($categories) )
    121115                    wp_create_categories($categories, $post_id);
    122116            }
     
    131125                    preg_match('|<body>(.*?)</body>|is', $comment, $comment_content);
    132126                    $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 );
    134128
    135129                    // Clean up content
Note: See TracChangeset for help on using the changeset viewer.