Skip to content

Commit f7f8cab

Browse files
committed
🐛 files from multilanguage setups did not get fingerprinted
Signed-off-by: Bruno Meilick <[email protected]>
1 parent cf7848b commit f7f8cab

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

classes/FingerprintFile.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ public function fileRoot(): string
153153
if ($this->isKirbyFile) {
154154
return $this->file->root();
155155
}
156-
$path = ltrim(kirby()->site()->url(), DIRECTORY_SEPARATOR);
156+
$url = kirby()->site()->url();
157+
if (kirby()->language()) {
158+
$url = rtrim($url, '/' . kirby()->language()->code());
159+
}
160+
$path = ltrim($url, DIRECTORY_SEPARATOR);
157161
$uri = ltrim(str_replace($path, '', $this->file), DIRECTORY_SEPARATOR);
158162
return kirby()->roots()->index() . DIRECTORY_SEPARATOR . $uri;
159163
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-fingerprint",
33
"type": "kirby-plugin",
4-
"version": "3.0.6",
4+
"version": "3.0.7",
55
"description": "File Method and css/js helper to add cachebusting hash and optional Subresource Integrity to file",
66
"license": "MIT",
77
"authors": [

0 commit comments

Comments
 (0)