Skip to content

Commit

Permalink
Merge branch '4.8' of https://github.com/craftcms/cms into 5.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG-WIP.md
  • Loading branch information
brandonkelly committed Feb 5, 2024
2 parents dc0d8b9 + f52cbee commit bae149c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Added support for element partial templates. ([#14284](https://github.com/craftcms/cms/pull/14284))
- Added the `partialTemplatesPath` config setting. ([#14284](https://github.com/craftcms/cms/pull/14284))
- Garbage collection now deletes orphaned nested entries.
- The `{% js %}` and `{% css %}` tags now support `.js.gz` and `.css.gz` URLs. ([#14243](https://github.com/craftcms/cms/issues/14243))
- Added `craft\base\Element::render()`. ([#14284](https://github.com/craftcms/cms/pull/14284))
- Added `craft\elements\ElementCollection::render()`. ([#14284](https://github.com/craftcms/cms/pull/14284))
- Added `craft\elements\NestedElementManager::$allowDeletion`.
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private static function _profileToken(string $type, string $name, int $count): s
public static function css(string $css, array $options = [], ?string $key = null): void
{
// Is this a CSS file?
if (preg_match('/^[^\r\n]+\.css$/i', $css) || UrlHelper::isAbsoluteUrl($css)) {
if (preg_match('/^[^\r\n]+\.css(\.gz)?$/i', $css) || UrlHelper::isAbsoluteUrl($css)) {
Craft::$app->getView()->registerCssFile($css, $options, $key);
} else {
Craft::$app->getView()->registerCss($css, $options, $key);
Expand All @@ -291,7 +291,7 @@ public static function css(string $css, array $options = [], ?string $key = null
public static function js(string $js, array $options = [], ?string $key = null): void
{
// Is this a JS file?
if (preg_match('/^[^\r\n]+\.js$/i', $js) || UrlHelper::isAbsoluteUrl($js)) {
if (preg_match('/^[^\r\n]+\.js(\.gz)?$/i', $js) || UrlHelper::isAbsoluteUrl($js)) {
Craft::$app->getView()->registerJsFile($js, $options, $key);
} else {
$position = $options['position'] ?? View::POS_READY;
Expand Down

0 comments on commit bae149c

Please sign in to comment.