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/content-.../inc
File: class-ps-helper.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace passster;
[2] Fix | Delete
[3] Fix | Delete
use Exception ;
[4] Fix | Delete
class PS_Helper
[5] Fix | Delete
{
[6] Fix | Delete
/**
[7] Fix | Delete
* Get string between two strings.
[8] Fix | Delete
*
[9] Fix | Delete
* @param string $string string to find.
[10] Fix | Delete
* @param string $start start string.
[11] Fix | Delete
* @param string $end end string.
[12] Fix | Delete
*
[13] Fix | Delete
* @return string
[14] Fix | Delete
*/
[15] Fix | Delete
public static function get_string_between( string $string, string $start, string $end ) : string
[16] Fix | Delete
{
[17] Fix | Delete
$string = ' ' . $string;
[18] Fix | Delete
$ini = strpos( $string, $start );
[19] Fix | Delete
if ( $ini == 0 ) {
[20] Fix | Delete
return '';
[21] Fix | Delete
}
[22] Fix | Delete
$ini += strlen( $start );
[23] Fix | Delete
$len = strpos( $string, $end, $ini ) - $ini;
[24] Fix | Delete
return substr( $string, $ini, $len );
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Preg matches shortcode and return cleaned output.
[29] Fix | Delete
*
[30] Fix | Delete
* @param string $content given content.
[31] Fix | Delete
*
[32] Fix | Delete
* @return string
[33] Fix | Delete
*/
[34] Fix | Delete
public static function get_shortcode_content( string $content, $password ) : string
[35] Fix | Delete
{
[36] Fix | Delete
preg_match( '/\\[passster.*password="' . $password . '".*?\\]/', $content, $matches );
[37] Fix | Delete
$string = '';
[38] Fix | Delete
if ( isset( $matches ) && !empty($matches) ) {
[39] Fix | Delete
foreach ( $matches as $match ) {
[40] Fix | Delete
$string = self::get_string_between( $content, $match, '[/passster]' );
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
return $string;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
}
[47] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function