Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/wp-admin/includes/export.php

    r17989 r17416  
    5050        $post_types = get_post_types( array( 'can_export' => true ) );
    5151        $esses = array_fill( 0, count($post_types), '%s' );
    52         $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
     52        $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (". implode(',',$esses) .")", $post_types );
    5353    }
    5454
     
    124124
    125125        // $str = ent2ncr(esc_html($str));
    126         $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>';
     126        $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
    127127
    128128        return $str;
     
    351351    // fetch 20 posts at a time rather than loading the entire table into memory
    352352    while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
    353     $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
     353    $where = "WHERE ID IN (" . join( ',', $next_posts ) . ")";
    354354    $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
    355355
     
    385385<?php   wxr_post_taxonomy(); ?>
    386386<?php   $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
    387         foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : ?>
     387        if ( $postmeta ) : foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : ?>
    388388        <wp:postmeta>
    389389            <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
    390390            <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
    391391        </wp:postmeta>
    392 <?php   endif; endforeach; ?>
     392<?php   endif; endforeach; endif; ?>
    393393<?php   $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
    394         foreach ( $comments as $c ) : ?>
     394        if ( $comments ) : foreach ( $comments as $c ) : ?>
    395395        <wp:comment>
    396396            <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
     
    406406            <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
    407407            <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
    408 <?php       $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
    409             foreach ( $c_meta as $meta ) : ?>
    410             <wp:commentmeta>
    411                 <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
    412                 <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
    413             </wp:commentmeta>
    414 <?php       endforeach; ?>
    415408        </wp:comment>
    416 <?php   endforeach; ?>
     409<?php   endforeach; endif; ?>
    417410    </item>
    418411<?php
Note: See TracChangeset for help on using the changeset viewer.