From 3bd4f9499a65edf85babb1449de29fc068f27ffe Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 26 May 2020 08:35:49 -0600 Subject: [PATCH 1/7] cherry picked #1925 fix from 1.7 to 1.6 Signed-off-by: Andy Miller --- CHANGELOG.md | 6 ++++++ system/blueprints/config/system.yaml | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 547285449..37fe33e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.6.26 +## mm/dd/2020 + +1. [](#bugfix) + * Fixed blueprint for `system.pages.hide_empty_folders` [#1925](https://github.com/getgrav/grav/issues/2925) + # v1.6.25 ## 05/14/2020 diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 560067ff1..30256be35 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -241,13 +241,15 @@ form: type: commalist pages.hide_empty_folders: - type: selectize - size: large - label: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS - help: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS_HELP - classes: fancy - validate: - type: commalist + type: toggle + label: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS + help: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS_HELP + highlight: 0 + options: + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool pages.url_taxonomy_filters: type: toggle From aaa636f3572fa8136b7da16ffbaed9931e6a4123 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 4 Jun 2020 14:31:22 -0600 Subject: [PATCH 2/7] cleaner handling of cropZoom Signed-off-by: Andy Miller --- system/src/Grav/Common/Page/Medium/ImageMedium.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Page/Medium/ImageMedium.php b/system/src/Grav/Common/Page/Medium/ImageMedium.php index 1925bef81..13c142aba 100644 --- a/system/src/Grav/Common/Page/Medium/ImageMedium.php +++ b/system/src/Grav/Common/Page/Medium/ImageMedium.php @@ -516,6 +516,15 @@ class ImageMedium extends Medium return $this; } + /** + * Handle this commonly used variant + */ + public function cropZoom() + { + $this->__call('zoomCrop', func_get_args()); + return $this; + } + /** * Forward the call to the image processing method. * @@ -525,10 +534,6 @@ class ImageMedium extends Medium */ public function __call($method, $args) { - if ($method === 'cropZoom') { - $method = 'zoomCrop'; - } - if (!\in_array($method, self::$magic_actions, true)) { return parent::__call($method, $args); } From bfbe4ce1b847ade2df074b1df5900b1daa3a2e7f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 4 Jun 2020 14:42:38 -0600 Subject: [PATCH 3/7] option to control supported attributes in markdown links Signed-off-by: Andy Miller --- CHANGELOG.md | 2 ++ system/blueprints/config/system.yaml | 10 ++++++++++ system/config/system.yaml | 6 ++++++ system/src/Grav/Common/Page/Markdown/Excerpts.php | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37fe33e86..9ad0ba69b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.6.26 ## mm/dd/2020 +1. [](#improved) + * Added new configuration option to control the supported attributes in markdown links [#2882](https://github.com/getgrav/grav/issues/2882) 1. [](#bugfix) * Fixed blueprint for `system.pages.hide_empty_folders` [#1925](https://github.com/getgrav/grav/issues/2925) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 30256be35..8899c2854 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -515,6 +515,16 @@ form: validate: type: bool + pages.markdown.valid_link_attributes: + type: selectize + size: large + label: PLUGIN_ADMIN.VALID_LINK_ATTRIBUTES + help: PLUGIN_ADMIN.VALID_LINK_ATTRIBUTES_HELP + placeholder: "rel, target, id, class, classes" + classes: fancy + validate: + type: commalist + caching: type: tab title: PLUGIN_ADMIN.CACHING diff --git a/system/config/system.yaml b/system/config/system.yaml index f11fe53be..438d0e326 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -59,6 +59,12 @@ pages: special_chars: # List of special characters to automatically convert to entities '>': 'gt' '<': 'lt' + valid_link_attributes: # Valid attributes to pass through via markdown links + - rel + - target + - id + - class + - classes types: [html,htm,xml,txt,json,rss,atom] # list of valid page types append_url_extension: '' # Append page's extension in Page urls (e.g. '.html' results in /path/page.html) expires: 604800 # Page expires time in seconds (604800 seconds = 7 days) diff --git a/system/src/Grav/Common/Page/Markdown/Excerpts.php b/system/src/Grav/Common/Page/Markdown/Excerpts.php index eaa13cbe8..b4ac69d88 100644 --- a/system/src/Grav/Common/Page/Markdown/Excerpts.php +++ b/system/src/Grav/Common/Page/Markdown/Excerpts.php @@ -87,7 +87,7 @@ class Excerpts ); // Valid attributes supported. - $valid_attributes = ['rel', 'target', 'id', 'class', 'classes']; + $valid_attributes = Grav::instance()['config']->get('system.pages.markdown.valid_link_attributes'); // Unless told to not process, go through actions. if (array_key_exists('noprocess', $actions)) { @@ -232,6 +232,7 @@ class Excerpts $url_parts = is_string($url) ? $this->parseUrl($url) : $url; $actions = []; + // if there is a query, then parse it and build action calls if (isset($url_parts['query'])) { $actions = array_reduce( From 7faaff304aa0ef689a91dd7f45b1d2c175f07007 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 5 Jun 2020 12:26:30 -0600 Subject: [PATCH 4/7] PSR fix Signed-off-by: Andy Miller --- system/src/Grav/Common/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Plugin.php b/system/src/Grav/Common/Plugin.php index 8729a519f..727fd95ef 100644 --- a/system/src/Grav/Common/Plugin.php +++ b/system/src/Grav/Common/Plugin.php @@ -305,7 +305,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess // Create new config object and set it on the page object so it's cached for next time $page->modifyHeader($class_name_merged, new Data($header)); - } else if (isset($page_header->{$class_name_merged})) { + } elseif (isset($page_header->{$class_name_merged})) { $merged = $page_header->{$class_name_merged}; $header = $merged->toArray(); } From ff6e5a20c33cb4be8b0746e682a0acce88b6a406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=B6rner?= Date: Sun, 7 Jun 2020 23:42:29 +0200 Subject: [PATCH 5/7] Fix: case-insensitive search of location header (#2932) looks good! --- system/src/Grav/Common/GPM/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index 72276076d..221ecf07d 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -409,7 +409,7 @@ class Response } else { $code = (int)curl_getinfo($rch, CURLINFO_HTTP_CODE); if ($code === 301 || $code === 302 || $code === 303) { - preg_match('/Location:(.*?)\n/', $header, $matches); + preg_match('/(?:^|\n)Location:(.*?)\n/i', $header, $matches); $uri = trim(array_pop($matches)); } else { $code = 0; From 12389b1e0defef4771a4cc0f6cadbf2ef4382c3e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 7 Jun 2020 19:46:18 -0600 Subject: [PATCH 6/7] =?UTF-8?q?JSON=20Route=20of=20homepage=20with=20no=20?= =?UTF-8?q?=E2=80=98route=E2=80=99=20set=20is=20valid=20[form#425]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Miller --- CHANGELOG.md | 1 + system/src/Grav/Framework/Route/Route.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad0ba69b..82f06bf5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Added new configuration option to control the supported attributes in markdown links [#2882](https://github.com/getgrav/grav/issues/2882) 1. [](#bugfix) * Fixed blueprint for `system.pages.hide_empty_folders` [#1925](https://github.com/getgrav/grav/issues/2925) + * JSON Route of homepage with no ‘route’ set is valid [form#425](https://github.com/getgrav/grav-plugin-form/issues/425) # v1.6.25 ## 05/14/2020 diff --git a/system/src/Grav/Framework/Route/Route.php b/system/src/Grav/Framework/Route/Route.php index 58224fee7..94ce57b60 100644 --- a/system/src/Grav/Framework/Route/Route.php +++ b/system/src/Grav/Framework/Route/Route.php @@ -344,9 +344,8 @@ class Route $parts[] = $this->language; } - if ($this->route !== '') { - $parts[] = $this->extension ? $this->route . '.' . $this->extension : $this->route; - } + $parts[] = $this->extension ? $this->route . '.' . $this->extension : $this->route; + if ($this->gravParams) { $parts[] = RouteFactory::buildParams($this->gravParams); From e66f6583b117894286a1bedb625e4c63c5a1f4c5 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 8 Jun 2020 15:49:51 -0600 Subject: [PATCH 7/7] prepare for release Signed-off-by: Andy Miller --- CHANGELOG.md | 5 +++-- system/defines.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82f06bf5a..bf464b04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ # v1.6.26 -## mm/dd/2020 +## 06/08/2020 1. [](#improved) * Added new configuration option to control the supported attributes in markdown links [#2882](https://github.com/getgrav/grav/issues/2882) 1. [](#bugfix) * Fixed blueprint for `system.pages.hide_empty_folders` [#1925](https://github.com/getgrav/grav/issues/2925) - * JSON Route of homepage with no ‘route’ set is valid [form#425](https://github.com/getgrav/grav-plugin-form/issues/425) + * JSON Route of homepage with no ‘route’ set is valid + * Fix case-insensitive search of location header [form#425](https://github.com/getgrav/grav-plugin-form/issues/425) # v1.6.25 ## 05/14/2020 diff --git a/system/defines.php b/system/defines.php index cde05d032..35d9effa3 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.6.25'); +define('GRAV_VERSION', '1.6.26'); define('GRAV_TESTING', false); define('DS', '/');