$loadauth = esc_js( __('Preparing author mapping form...') );
$authhead = esc_js( __('Final Step: Author Mapping') );
$nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') );
+ $stopping = ''; //Missing String used below.
$title = __('Blogger Blogs');
$name = __('Blog Name');
$url = __('Blog URL');
return preg_replace( '|\s+|', ' ', $string );
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_post( $entry ) {
global $importing_blog;
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
// Clean up content
- $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);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
$comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) );
// Clean up 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 = str_replace('<br>', '<br />', $comment_content);
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
} else {
$comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
+ $comment = wp_filter_comment($comment);
$comment_id = wp_insert_comment($comment);
$this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id;
var $entry;
function AtomParser() {
-
$this->entry = new AtomEntry();
- $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
- $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
+ }
+
+ function _map_attrs_func( $k, $v ) {
+ return "$k=\"$v\"";
+ }
+
+ function _map_xmlns_func( $p, $n ) {
+ $xd = "xmlns";
+ if ( strlen( $n[0] ) > 0 )
+ $xd .= ":{$n[0]}";
+
+ return "{$xd}=\"{$n[1]}\"";
}
function parse($xml) {
foreach($attrs as $key => $value) {
$attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value);
}
- $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));
+ $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix)));
if(strlen($attrs_str) > 0) {
$attrs_str = " " . $attrs_str;
}
- $xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
+ $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
if(strlen($xmlns_str) > 0) {
$xmlns_str = " " . $xmlns_str;
}