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
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres.../inc/absolute...
File: BlockProtector.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPML\AbsoluteLinks;
[2] Fix | Delete
[3] Fix | Delete
[4] Fix | Delete
class BlockProtector {
[5] Fix | Delete
[6] Fix | Delete
private $protectedBlocks = [];
[7] Fix | Delete
[8] Fix | Delete
public function protect( $text ) {
[9] Fix | Delete
if ( ! function_exists( 'has_blocks' ) || ! has_blocks( $text ) ) {
[10] Fix | Delete
return $text;
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
$integrationClass = \WPML_Gutenberg_Integration::class;
[14] Fix | Delete
[15] Fix | Delete
$decodeForwardSlashes = function ( $str ) { return str_replace( '\\/', '/', $str ); };
[16] Fix | Delete
[17] Fix | Delete
$replaceBlockWithPlaceholder = function ( $text, $block ) {
[18] Fix | Delete
$key = md5( $block );
[19] Fix | Delete
$this->protectedBlocks[ $key ] = $block;
[20] Fix | Delete
[21] Fix | Delete
return str_replace( $block, $key, $text );
[22] Fix | Delete
};
[23] Fix | Delete
[24] Fix | Delete
return wpml_collect( \WPML_Gutenberg_Integration::parse_blocks( $text ) )
[25] Fix | Delete
->map( [ $integrationClass, 'sanitize_block' ] )
[26] Fix | Delete
->filter( [ $integrationClass, 'has_non_empty_attributes' ] )
[27] Fix | Delete
->map( [ $integrationClass, 'render_block' ] )
[28] Fix | Delete
->map( $decodeForwardSlashes )
[29] Fix | Delete
->reduce( $replaceBlockWithPlaceholder, $text );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
public function unProtect( $text ) {
[33] Fix | Delete
foreach ( $this->protectedBlocks as $key => $value ) {
[34] Fix | Delete
$text = str_replace( $key, $value, $text );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
return $text;
[38] Fix | Delete
}
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function