Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-bu.../com/libs
File: parsers.php
[500] Fix | Delete
} elseif ( false !== ( $pos = strpos( $importline, "<$tag>" ) ) ) {
[501] Fix | Delete
// Take note of any content after the opening tag
[502] Fix | Delete
$multiline_content = trim( substr( $importline, $pos + strlen( $tag ) + 2 ) );
[503] Fix | Delete
[504] Fix | Delete
// We don't want to have this line added to `$is_multiline` below.
[505] Fix | Delete
$importline = '';
[506] Fix | Delete
$in_multiline = $tag;
[507] Fix | Delete
[508] Fix | Delete
} elseif ( false !== ( $pos = strpos( $importline, "</$tag>" ) ) ) {
[509] Fix | Delete
$in_multiline = false;
[510] Fix | Delete
$multiline_content .= trim( substr( $importline, 0, $pos ) );
[511] Fix | Delete
[512] Fix | Delete
$this->{$handler[0]}[] = call_user_func( $handler[1], $multiline_content );
[513] Fix | Delete
}
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
if ( $in_multiline && $importline ) {
[517] Fix | Delete
$multiline_content .= $importline . "\n";
[518] Fix | Delete
}
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
$this->fclose($fp);
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
if ( ! $wxr_version )
[525] Fix | Delete
return new \WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'popup-builder' ) );
[526] Fix | Delete
[527] Fix | Delete
return array(
[528] Fix | Delete
'authors' => $this->authors,
[529] Fix | Delete
'posts' => $this->posts,
[530] Fix | Delete
'categories' => $this->categories,
[531] Fix | Delete
'tags' => $this->tags,
[532] Fix | Delete
'terms' => $this->terms,
[533] Fix | Delete
'base_url' => $this->base_url,
[534] Fix | Delete
'base_blog_url' => $this->base_blog_url,
[535] Fix | Delete
'version' => $wxr_version
[536] Fix | Delete
);
[537] Fix | Delete
}
[538] Fix | Delete
[539] Fix | Delete
function get_tag( $string, $tag ) {
[540] Fix | Delete
preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
[541] Fix | Delete
if ( isset( $return[1] ) ) {
[542] Fix | Delete
if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) {
[543] Fix | Delete
if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
[544] Fix | Delete
preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
[545] Fix | Delete
$return = '';
[546] Fix | Delete
foreach( $matches[1] as $match )
[547] Fix | Delete
$return .= $match;
[548] Fix | Delete
} else {
[549] Fix | Delete
$return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
[550] Fix | Delete
}
[551] Fix | Delete
} else {
[552] Fix | Delete
$return = $return[1];
[553] Fix | Delete
}
[554] Fix | Delete
} else {
[555] Fix | Delete
$return = '';
[556] Fix | Delete
}
[557] Fix | Delete
return $return;
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
function process_category( $c ) {
[561] Fix | Delete
return array(
[562] Fix | Delete
'term_id' => $this->get_tag( $c, 'wp:term_id' ),
[563] Fix | Delete
'cat_name' => $this->get_tag( $c, 'wp:cat_name' ),
[564] Fix | Delete
'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ),
[565] Fix | Delete
'category_parent' => $this->get_tag( $c, 'wp:category_parent' ),
[566] Fix | Delete
'category_description' => $this->get_tag( $c, 'wp:category_description' ),
[567] Fix | Delete
);
[568] Fix | Delete
}
[569] Fix | Delete
[570] Fix | Delete
function process_tag( $t ) {
[571] Fix | Delete
return array(
[572] Fix | Delete
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
[573] Fix | Delete
'tag_name' => $this->get_tag( $t, 'wp:tag_name' ),
[574] Fix | Delete
'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ),
[575] Fix | Delete
'tag_description' => $this->get_tag( $t, 'wp:tag_description' ),
[576] Fix | Delete
);
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
function process_term( $t ) {
[580] Fix | Delete
return array(
[581] Fix | Delete
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
[582] Fix | Delete
'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ),
[583] Fix | Delete
'slug' => $this->get_tag( $t, 'wp:term_slug' ),
[584] Fix | Delete
'term_parent' => $this->get_tag( $t, 'wp:term_parent' ),
[585] Fix | Delete
'term_name' => $this->get_tag( $t, 'wp:term_name' ),
[586] Fix | Delete
'term_description' => $this->get_tag( $t, 'wp:term_description' ),
[587] Fix | Delete
);
[588] Fix | Delete
}
[589] Fix | Delete
[590] Fix | Delete
function process_author( $a ) {
[591] Fix | Delete
return array(
[592] Fix | Delete
'author_id' => $this->get_tag( $a, 'wp:author_id' ),
[593] Fix | Delete
'author_login' => $this->get_tag( $a, 'wp:author_login' ),
[594] Fix | Delete
'author_email' => $this->get_tag( $a, 'wp:author_email' ),
[595] Fix | Delete
'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ),
[596] Fix | Delete
'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ),
[597] Fix | Delete
'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ),
[598] Fix | Delete
);
[599] Fix | Delete
}
[600] Fix | Delete
[601] Fix | Delete
function process_post( $post ) {
[602] Fix | Delete
$post_id = $this->get_tag( $post, 'wp:post_id' );
[603] Fix | Delete
$post_title = $this->get_tag( $post, 'title' );
[604] Fix | Delete
$post_date = $this->get_tag( $post, 'wp:post_date' );
[605] Fix | Delete
$post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
[606] Fix | Delete
$comment_status = $this->get_tag( $post, 'wp:comment_status' );
[607] Fix | Delete
$ping_status = $this->get_tag( $post, 'wp:ping_status' );
[608] Fix | Delete
$status = $this->get_tag( $post, 'wp:status' );
[609] Fix | Delete
$post_name = $this->get_tag( $post, 'wp:post_name' );
[610] Fix | Delete
$post_parent = $this->get_tag( $post, 'wp:post_parent' );
[611] Fix | Delete
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
[612] Fix | Delete
$post_type = $this->get_tag( $post, 'wp:post_type' );
[613] Fix | Delete
$post_password = $this->get_tag( $post, 'wp:post_password' );
[614] Fix | Delete
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
[615] Fix | Delete
$guid = $this->get_tag( $post, 'guid' );
[616] Fix | Delete
$post_author = $this->get_tag( $post, 'dc:creator' );
[617] Fix | Delete
[618] Fix | Delete
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
[619] Fix | Delete
$post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt );
[620] Fix | Delete
$post_excerpt = str_replace( '<br>', '<br />', $post_excerpt );
[621] Fix | Delete
$post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt );
[622] Fix | Delete
[623] Fix | Delete
$post_content = $this->get_tag( $post, 'content:encoded' );
[624] Fix | Delete
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
[625] Fix | Delete
$post_content = str_replace( '<br>', '<br />', $post_content );
[626] Fix | Delete
$post_content = str_replace( '<hr>', '<hr />', $post_content );
[627] Fix | Delete
[628] Fix | Delete
$postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt',
[629] Fix | Delete
'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent',
[630] Fix | Delete
'menu_order', 'post_type', 'post_password', 'is_sticky'
[631] Fix | Delete
);
[632] Fix | Delete
[633] Fix | Delete
$attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
[634] Fix | Delete
if ( $attachment_url )
[635] Fix | Delete
$postdata['attachment_url'] = $attachment_url;
[636] Fix | Delete
[637] Fix | Delete
preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
[638] Fix | Delete
foreach ( $terms as $t ) {
[639] Fix | Delete
$post_terms[] = array(
[640] Fix | Delete
'slug' => $t[2],
[641] Fix | Delete
'domain' => $t[1],
[642] Fix | Delete
'name' => str_replace( array( '<![CDATA[', ']]>' ), '', $t[3] ),
[643] Fix | Delete
);
[644] Fix | Delete
}
[645] Fix | Delete
if ( ! empty( $post_terms ) ) $postdata['terms'] = $post_terms;
[646] Fix | Delete
[647] Fix | Delete
preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments );
[648] Fix | Delete
$comments = $comments[1];
[649] Fix | Delete
if ( $comments ) {
[650] Fix | Delete
foreach ( $comments as $comment ) {
[651] Fix | Delete
preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta );
[652] Fix | Delete
$commentmeta = $commentmeta[1];
[653] Fix | Delete
$c_meta = array();
[654] Fix | Delete
foreach ( $commentmeta as $m ) {
[655] Fix | Delete
$c_meta[] = array(
[656] Fix | Delete
'key' => $this->get_tag( $m, 'wp:meta_key' ),
[657] Fix | Delete
'value' => $this->get_tag( $m, 'wp:meta_value' ),
[658] Fix | Delete
);
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
$post_comments[] = array(
[662] Fix | Delete
'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ),
[663] Fix | Delete
'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ),
[664] Fix | Delete
'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ),
[665] Fix | Delete
'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ),
[666] Fix | Delete
'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ),
[667] Fix | Delete
'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ),
[668] Fix | Delete
'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ),
[669] Fix | Delete
'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ),
[670] Fix | Delete
'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
[671] Fix | Delete
'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
[672] Fix | Delete
'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
[673] Fix | Delete
'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
[674] Fix | Delete
'commentmeta' => $c_meta,
[675] Fix | Delete
);
[676] Fix | Delete
}
[677] Fix | Delete
}
[678] Fix | Delete
if ( ! empty( $post_comments ) ) $postdata['comments'] = $post_comments;
[679] Fix | Delete
[680] Fix | Delete
preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta );
[681] Fix | Delete
$postmeta = $postmeta[1];
[682] Fix | Delete
if ( $postmeta ) {
[683] Fix | Delete
foreach ( $postmeta as $p ) {
[684] Fix | Delete
$post_postmeta[] = array(
[685] Fix | Delete
'key' => $this->get_tag( $p, 'wp:meta_key' ),
[686] Fix | Delete
'value' => $this->get_tag( $p, 'wp:meta_value' ),
[687] Fix | Delete
);
[688] Fix | Delete
}
[689] Fix | Delete
}
[690] Fix | Delete
if ( ! empty( $post_postmeta ) ) $postdata['postmeta'] = $post_postmeta;
[691] Fix | Delete
[692] Fix | Delete
return $postdata;
[693] Fix | Delete
}
[694] Fix | Delete
[695] Fix | Delete
function _normalize_tag( $matches ) {
[696] Fix | Delete
return '<' . strtolower( $matches[1] );
[697] Fix | Delete
}
[698] Fix | Delete
[699] Fix | Delete
function fopen( $filename, $mode = 'r' ) {
[700] Fix | Delete
if ( $this->has_gzip )
[701] Fix | Delete
return gzopen( $filename, $mode );
[702] Fix | Delete
return fopen( $filename, $mode );// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen
[703] Fix | Delete
}
[704] Fix | Delete
[705] Fix | Delete
function feof( $fp ) {
[706] Fix | Delete
if ( $this->has_gzip )
[707] Fix | Delete
return gzeof( $fp );
[708] Fix | Delete
return feof( $fp );
[709] Fix | Delete
}
[710] Fix | Delete
[711] Fix | Delete
function fgets( $fp, $len = 8192 ) {
[712] Fix | Delete
if ( $this->has_gzip )
[713] Fix | Delete
return gzgets( $fp, $len );
[714] Fix | Delete
return fgets( $fp, $len );
[715] Fix | Delete
}
[716] Fix | Delete
[717] Fix | Delete
function fclose( $fp ) {
[718] Fix | Delete
if ( $this->has_gzip )
[719] Fix | Delete
return gzclose( $fp );
[720] Fix | Delete
return fclose( $fp );// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
[721] Fix | Delete
}
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function