~katiekitty/+junk/wordpress-byet

« back to all changes in this revision

Viewing changes to wp-admin/import/livejournal.php

  • Committer: kserver
  • Date: 2010-05-15 01:16:36 UTC
  • Revision ID: kserver@kserver-desktop-20100515011636-mnr1j7t637suptdq
Wordpress 2.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
                echo '</ol>';
325
325
        }
326
326
 
 
327
        function _normalize_tag( $matches ) {
 
328
                return '<' . strtolower( $matches[1] );
 
329
        }
 
330
 
327
331
        function import_post( $post ) {
328
332
                global $wpdb;
329
333
 
350
354
 
351
355
                // Clean up content
352
356
                $post_content = $post['event'];
353
 
                $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $post_content );
 
357
                $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
354
358
                // XHTMLize some tags
355
359
                $post_content = str_replace( '<br>', '<br />', $post_content );
356
360
                $post_content = str_replace( '<hr>', '<hr />', $post_content );
531
535
 
532
536
                                // Parse this comment into an array and insert
533
537
                                $comment = $this->parse_comment( $comment );
 
538
                                $comment = wp_filter_comment( $comment );
534
539
                                $id = wp_insert_comment( $comment );
535
540
 
536
541
                                // Clear cache
581
586
                $comment_content = wpautop( $comment_content );
582
587
                $comment_content = str_replace( '<br>', '<br />', $comment_content );
583
588
                $comment_content = str_replace( '<hr>', '<hr />', $comment_content );
584
 
                $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content );
 
589
                $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content );
585
590
                $comment_content = $wpdb->escape( trim( $comment_content ) );
586
591
 
587
592
                // Get and convert the date
720
725
                        $this->protected_password = get_option( 'ljapi_protected_password' );
721
726
                }
722
727
 
723
 
                // Login to confirm the details are correct
 
728
                // Log in to confirm the details are correct
724
729
                if ( empty( $this->username ) || empty( $this->password ) ) {
725
730
                        ?>
726
731
                        <p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>