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/wp-conte.../plugins/smart-sl.../Nextend/SmartSli.../BackupSl...
File: ExportSlider.php
[500] Fix | Delete
return $this->addCSSFileWithContent($file, file_get_contents($file));
[501] Fix | Delete
}
[502] Fix | Delete
[503] Fix | Delete
private function addCSSFileWithContent($file, $fileContent) {
[504] Fix | Delete
$path = 'css/' . basename($file);
[505] Fix | Delete
[506] Fix | Delete
$this->basePath = dirname($file);
[507] Fix | Delete
$this->baseUrl = Filesystem::pathToAbsoluteURL($this->basePath);
[508] Fix | Delete
[509] Fix | Delete
$fileContent = preg_replace_callback('#url\([\'"]?([^"\'\)]+)[\'"]?\)#', array(
[510] Fix | Delete
$this,
[511] Fix | Delete
'replaceCSSImage'
[512] Fix | Delete
), $fileContent);
[513] Fix | Delete
[514] Fix | Delete
$this->files[$path] = $fileContent;
[515] Fix | Delete
[516] Fix | Delete
return Html::style($path, true, array(
[517] Fix | Delete
'media' => 'screen, print'
[518] Fix | Delete
)) . "\n";
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
public function replaceCSSImage($matches) {
[522] Fix | Delete
if (substr($matches[1], 0, 5) == 'data:') return $matches[0];
[523] Fix | Delete
if (substr($matches[1], 0, 4) == 'http') {
[524] Fix | Delete
$exploded = explode('?', $matches[1]);
[525] Fix | Delete
[526] Fix | Delete
$path = ResourceTranslator::toPath(ResourceTranslator::urlToResource($exploded[0]));
[527] Fix | Delete
if (strpos($path, $this->basePath) === 0) {
[528] Fix | Delete
$exploded = explode('?', $matches[1]);
[529] Fix | Delete
[530] Fix | Delete
return str_replace($matches[1], 'assets/' . $this->addFile($path) . '?' . $exploded[1], $matches[0]);
[531] Fix | Delete
} else {
[532] Fix | Delete
return $matches[0];
[533] Fix | Delete
}
[534] Fix | Delete
}
[535] Fix | Delete
if (substr($matches[1], 0, 2) == '//') return $matches[0];
[536] Fix | Delete
[537] Fix | Delete
$exploded = explode('?', $matches[1]);
[538] Fix | Delete
[539] Fix | Delete
$path = realpath($this->basePath . '/' . $exploded[0]);
[540] Fix | Delete
if ($path === false) {
[541] Fix | Delete
return 'url(' . str_replace(array(
[542] Fix | Delete
'http://',
[543] Fix | Delete
'https://'
[544] Fix | Delete
), '//', $this->baseUrl) . '/' . $matches[1] . ')';
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
return str_replace($matches[1], 'assets/' . $this->addFile($path), $matches[0]);
[548] Fix | Delete
}
[549] Fix | Delete
[550] Fix | Delete
protected function addFile($path) {
[551] Fix | Delete
$path = Filesystem::convertToRealDirectorySeparator($path);
[552] Fix | Delete
[553] Fix | Delete
if (!isset($this->imageTranslation[$path])) {
[554] Fix | Delete
$fileName = strtolower(basename($path));
[555] Fix | Delete
while (in_array($fileName, $this->usedNames)) {
[556] Fix | Delete
$fileName = $this->uniqueCounter . $fileName;
[557] Fix | Delete
$this->uniqueCounter++;
[558] Fix | Delete
}
[559] Fix | Delete
$this->usedNames[] = $fileName;
[560] Fix | Delete
$this->files['css/assets/' . $fileName] = file_get_contents($path);
[561] Fix | Delete
$this->imageTranslation[$path] = $fileName;
[562] Fix | Delete
} else {
[563] Fix | Delete
$fileName = $this->imageTranslation[$path];
[564] Fix | Delete
}
[565] Fix | Delete
[566] Fix | Delete
return $fileName;
[567] Fix | Delete
}
[568] Fix | Delete
}
[569] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function