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/smart-sl.../Nextend/Framewor.../Asset/Css
File: Cache.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Nextend\Framework\Asset\Css;
[2] Fix | Delete
[3] Fix | Delete
use Nextend\Framework\Asset\AbstractCache;
[4] Fix | Delete
use Nextend\Framework\Filesystem\Filesystem;
[5] Fix | Delete
use Nextend\Framework\Url\Url;
[6] Fix | Delete
[7] Fix | Delete
class Cache extends AbstractCache {
[8] Fix | Delete
[9] Fix | Delete
public $outputFileType = "css";
[10] Fix | Delete
[11] Fix | Delete
private $baseUrl = '';
[12] Fix | Delete
[13] Fix | Delete
private $basePath = '';
[14] Fix | Delete
[15] Fix | Delete
public function getAssetFileFolder() {
[16] Fix | Delete
return Filesystem::getWebCachePath() . DIRECTORY_SEPARATOR . $this->group . DIRECTORY_SEPARATOR;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
protected function parseFile($cache, $content, $originalFilePath) {
[20] Fix | Delete
[21] Fix | Delete
$this->basePath = dirname($originalFilePath);
[22] Fix | Delete
$this->baseUrl = Filesystem::pathToAbsoluteURL($this->basePath);
[23] Fix | Delete
[24] Fix | Delete
return preg_replace_callback('#url\([\'"]?([^"\'\)]+)[\'"]?\)#', array(
[25] Fix | Delete
$this,
[26] Fix | Delete
'makeAbsoluteUrl'
[27] Fix | Delete
), $content);
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
private function makeAbsoluteUrl($matches) {
[31] Fix | Delete
if (substr($matches[1], 0, 5) == 'data:') return $matches[0];
[32] Fix | Delete
if (substr($matches[1], 0, 4) == 'http') return $matches[0];
[33] Fix | Delete
if (substr($matches[1], 0, 2) == '//') return $matches[0];
[34] Fix | Delete
[35] Fix | Delete
$exploded = explode('?', $matches[1]);
[36] Fix | Delete
[37] Fix | Delete
$realPath = realpath($this->basePath . '/' . $exploded[0]);
[38] Fix | Delete
if ($realPath === false) {
[39] Fix | Delete
return 'url(' . str_replace(array(
[40] Fix | Delete
'http://',
[41] Fix | Delete
'https://'
[42] Fix | Delete
), '//', $this->baseUrl) . '/' . $matches[1] . ')';
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
$realPath = Filesystem::convertToRealDirectorySeparator($realPath);
[46] Fix | Delete
[47] Fix | Delete
return 'url(' . Url::pathToUri($realPath, false) . (isset($exploded[1]) ? '?' . $exploded[1] : '') . ')';
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function