mirror of
https://github.com/flarum/core.git
synced 2025-07-21 00:31:17 +02:00
Don't write/serve empty asset files
The new locale-specific CSS file doesn't have any content by default, so it's a waste to write it and serve it to the user.
This commit is contained in:
@@ -90,10 +90,15 @@ class RevisionCompiler implements CompilerInterface
|
|||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->putRevision($current);
|
|
||||||
|
|
||||||
$file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0);
|
$file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0);
|
||||||
file_put_contents($file, $this->compile());
|
|
||||||
|
if ($this->files || $this->strings) {
|
||||||
|
$this->putRevision($current);
|
||||||
|
|
||||||
|
file_put_contents($file, $this->compile());
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $file;
|
return $file;
|
||||||
|
@@ -343,7 +343,7 @@ class WebAppView
|
|||||||
{
|
{
|
||||||
return array_map(function ($file) use ($baseUrl) {
|
return array_map(function ($file) use ($baseUrl) {
|
||||||
return $baseUrl.str_replace(public_path(), '', $file);
|
return $baseUrl.str_replace(public_path(), '', $file);
|
||||||
}, $files);
|
}, array_filter($files));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user