This commit is contained in:
2021-12-06 13:54:48 +01:00
parent cfd6acbbb8
commit f5cb936c97
111 changed files with 2189 additions and 858 deletions

View File

@@ -92,6 +92,10 @@ abstract class BaseAsset extends PropertyObject
*/
public function init($asset, $options)
{
if (!$asset) {
return false;
}
$config = Grav::instance()['config'];
$uri = Grav::instance()['uri'];
@@ -259,6 +263,6 @@ abstract class BaseAsset extends PropertyObject
*/
protected function cssRewrite($file, $dir, $local)
{
return;
return '';
}
}

View File

@@ -254,7 +254,7 @@ class Pipeline extends PropertyObject
$old_url = ltrim($old_url, '/');
}
$new_url = ($local ? $this->base_url: '') . $old_url;
$new_url = ($local ? $this->base_url : '') . $old_url;
return str_replace($matches[2], $new_url, $matches[0]);
}, $file);

View File

@@ -68,8 +68,6 @@ trait AssetUtilsTrait
protected function gatherLinks(array $assets, $css = true)
{
$buffer = '';
foreach ($assets as $id => $asset) {
$local = true;
@@ -135,7 +133,7 @@ trait AssetUtilsTrait
$imports = [];
$file = (string)preg_replace_callback($regex, function ($matches) use (&$imports) {
$file = (string)preg_replace_callback($regex, static function ($matches) use (&$imports) {
$imports[] = $matches[0];
return '';
@@ -200,7 +198,7 @@ trait AssetUtilsTrait
}
if ($this->timestamp) {
if (Utils::contains($asset, '?') || $querystring) {
if ($querystring || Utils::contains($asset, '?')) {
$querystring .= '&' . $this->timestamp;
} else {
$querystring .= '?' . $this->timestamp;