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/clone/wp-conte.../plugins/accelera.../includes
File: change-log.php
<?php
[0] Fix | Delete
// Exit if accessed directly
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
// This file only loads once on welcome page
[5] Fix | Delete
function ampforwp_strposOffset($search, $string, $offset)
[6] Fix | Delete
{
[7] Fix | Delete
/*** explode the string ***/
[8] Fix | Delete
$arr = explode($search, $string);
[9] Fix | Delete
/*** check the search is not out of bounds ***/
[10] Fix | Delete
switch( $offset )
[11] Fix | Delete
{
[12] Fix | Delete
case $offset == 0:
[13] Fix | Delete
return false;
[14] Fix | Delete
break;
[15] Fix | Delete
[16] Fix | Delete
case $offset > max(array_keys($arr)):
[17] Fix | Delete
return false;
[18] Fix | Delete
break;
[19] Fix | Delete
[20] Fix | Delete
default:
[21] Fix | Delete
return strlen(implode($search, array_slice($arr, 0, $offset)));
[22] Fix | Delete
}
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
function ampforwp_nl2p($string, $only_if_no_html = TRUE) {
[26] Fix | Delete
// Replace the input string by default unless we find a reason not to.
[27] Fix | Delete
$replace = TRUE;
[28] Fix | Delete
// If the only_if_no_html flag is set, then we only want to replace if no HTML is detected
[29] Fix | Delete
if ($only_if_no_html) {
[30] Fix | Delete
// Create a string of the input string with stripped tags
[31] Fix | Delete
$str2 = strip_tags($string);
[32] Fix | Delete
// If there is a difference, then HTML must have been in the input string.
[33] Fix | Delete
// Since HTML already exists, we do not want to replace new lines with HTML
[34] Fix | Delete
if ($str2 != $string) {
[35] Fix | Delete
$replace = FALSE;
[36] Fix | Delete
}
[37] Fix | Delete
}
[38] Fix | Delete
// Now return the replacement string if we are supposed to replace it.
[39] Fix | Delete
if ($replace) {
[40] Fix | Delete
return
[41] Fix | Delete
preg_replace('#\*(.*?)\n#', '<li>$1</li>', $string);
[42] Fix | Delete
}
[43] Fix | Delete
// Otherwise, we just return the input string.
[44] Fix | Delete
return $string;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
$readme_file = AMPFORWP_PLUGIN_DIR.'changelog.txt';
[48] Fix | Delete
$readme = file_get_contents($readme_file);
[49] Fix | Delete
[50] Fix | Delete
$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
[51] Fix | Delete
[52] Fix | Delete
$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
[53] Fix | Delete
$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
[54] Fix | Delete
[55] Fix | Delete
$readme = preg_replace('/=== (.*?) ===/', '<h2>\\1</h2>', $readme);
[56] Fix | Delete
$readme = preg_replace('/== (.*?) ==/', '<h3>\\1</h3>', $readme);
[57] Fix | Delete
$readme = preg_replace('/= (.*?) =/', '</ul><h4>\\1</h4><ul>', $readme);
[58] Fix | Delete
[59] Fix | Delete
[60] Fix | Delete
$pos = strpos($readme,'<h3>Changelog</h3>');
[61] Fix | Delete
$changelogtxt = substr($readme,$pos);
[62] Fix | Delete
[63] Fix | Delete
$ending = ampforwp_strposOffset('<h4>', $changelogtxt, 4);
[64] Fix | Delete
$readme = substr($changelogtxt,0,$ending);
[65] Fix | Delete
[66] Fix | Delete
preg_match_all('#\[([^\[]+)\]\(([^\)]+)\)#', $readme, $matches);
[67] Fix | Delete
[68] Fix | Delete
if(is_array($matches) && count($matches)>2){
[69] Fix | Delete
$foundText = $matches[0];
[70] Fix | Delete
$foundTitle = $matches[1];
[71] Fix | Delete
$foundLink = $matches[2];
[72] Fix | Delete
foreach ($foundTitle as $key => $value) {
[73] Fix | Delete
$replaceHtml = '<a href="'.$foundLink[$key].'">'.$value.'</a>';
[74] Fix | Delete
$readme = str_replace($foundText[$key], $replaceHtml, $readme);
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
echo ampforwp_wp_kses(ampforwp_nl2p($readme,false));
[79] Fix | Delete
[80] Fix | Delete
?>
[81] Fix | Delete
[82] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function