echo '</ol>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_post( $post ) {
global $wpdb;
// Clean up content
$post_content = $post['event'];
- $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $post_content );
+ $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
// XHTMLize some tags
$post_content = str_replace( '<br>', '<br />', $post_content );
$post_content = str_replace( '<hr>', '<hr />', $post_content );
// Parse this comment into an array and insert
$comment = $this->parse_comment( $comment );
+ $comment = wp_filter_comment( $comment );
$id = wp_insert_comment( $comment );
// Clear cache
$comment_content = wpautop( $comment_content );
$comment_content = str_replace( '<br>', '<br />', $comment_content );
$comment_content = str_replace( '<hr>', '<hr />', $comment_content );
- $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content );
+ $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content );
$comment_content = $wpdb->escape( trim( $comment_content ) );
// Get and convert the date
$this->protected_password = get_option( 'ljapi_protected_password' );
}
- // Login to confirm the details are correct
+ // Log in to confirm the details are correct
if ( empty( $this->username ) || empty( $this->password ) ) {
?>
<p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>