From bc22c8d2b1efad6f28608aa937e9dd0485eac6d7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 10 Dec 2020 10:41:42 -0700 Subject: [PATCH 1/3] Allow all css and js to be seached via robots.txt by default --- CHANGELOG.md | 2 ++ robots.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e48b89d83..88252e731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.6.31 ## mm/dd/2020 +1. [](#improved) + * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) 1. [](#bugfix) * Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990) diff --git a/robots.txt b/robots.txt index 96406e45e..9ac278fd4 100644 --- a/robots.txt +++ b/robots.txt @@ -11,3 +11,5 @@ Allow: /user/pages/ Allow: /user/themes/ Allow: /user/images/ Allow: / +Allow: *.css$ +Allow: *.js$ \ No newline at end of file From 1c63f4bf46af98c2eab86dbd845fadcf94ebb9e9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 10 Dec 2020 10:54:38 -0700 Subject: [PATCH 2/3] Fix Twig `svg_image()` issue with classes applied to all elements #3068 --- CHANGELOG.md | 3 ++- system/src/Grav/Common/Twig/TwigExtension.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88252e731..dcbe25d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## mm/dd/2020 1. [](#improved) - * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) + * Allow all CSS and JS via `robots.txt` [#2006](https://github.com/getgrav/grav/issues/2006) [#3067](https://github.com/getgrav/grav/issues/3067) 1. [](#bugfix) * Fixed `pages` field escaping issues, needs admin update, too [admin#1990](https://github.com/getgrav/grav-plugin-admin/issues/1990) + * Fix `svg-image` issue with classes applied to all elements [#3068](https://github.com/getgrav/grav/issues/3068) # v1.6.30 ## 12/03/2020 diff --git a/system/src/Grav/Common/Twig/TwigExtension.php b/system/src/Grav/Common/Twig/TwigExtension.php index 5f234dfd5..3da65dd2a 100644 --- a/system/src/Grav/Common/Twig/TwigExtension.php +++ b/system/src/Grav/Common/Twig/TwigExtension.php @@ -1477,12 +1477,13 @@ class TwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsIn $matched = false; //Look for existing class - $svg = preg_replace_callback('/^/', function($matches) use ($classes, &$matched) { + $svg = preg_replace_callback('/^]*(class=\")([^"]*)(\")[^>]*>/', function($matches) use ($classes, &$matched) { if (isset($matches[2])) { $new_classes = $matches[2] . $classes; $matched = true; return str_replace($matches[1], "class=\"$new_classes\"", $matches[0]); } + return $matches[0]; }, $svg ); From 249c2f1e690b8d6944b637102c734449e25dc135 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 10 Dec 2020 11:24:28 -0800 Subject: [PATCH 3/3] Update composer first thing --- .github/workflows/tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f99cefe90..c20f901ce 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -27,6 +27,9 @@ jobs: extensions: opcache, gd coverage: none + - name: Update composer + run: composer update + - name: Validate composer.json and composer.lock run: composer validate