From e2ee02a71d4fb0b0100008a5ff49dbe01ccdbfd5 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 18 Jan 2017 10:42:13 +0200 Subject: [PATCH 1/3] Fixed `page.collection()` returning array and not Collection object when header variable did not exist --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Page/Page.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 426449e002..cd474a839a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.1.14 +## XX/XX/2017 + +1. [](#bugfix) + * Fixed `page.collection()` returning array and not Collection object when header variable did not exist + # v1.1.13 ## 01/17/2017 diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 013a3ab324..fdd976e2f5 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2288,7 +2288,7 @@ public function collection($params = 'content', $pagination = true) } if (!isset($params['items'])) { - return []; + return new Collection(); } $collection = $this->evaluate($params['items']); From 61c0c31992e925ac6ec6c5b37bc6da9b7ea17f77 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 18 Jan 2017 15:02:53 -0700 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20to=20allow=20you=20to=20enable=20cont?= =?UTF-8?q?ent-encoding:=20identity.=20=20Set=20to=20=E2=80=98none?= =?UTF-8?q?=E2=80=99=20by=20default.=20#548?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + system/blueprints/config/system.yaml | 11 +++++++++++ system/config/system.yaml | 1 + system/src/Grav/Common/Grav.php | 7 ++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd474a839a..4bda03b8cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#bugfix) * Fixed `page.collection()` returning array and not Collection object when header variable did not exist + * Revert `Content-Encoding: identity` fix, and let you set `cache: allow_webserver_gzip:` option to switch to `identity` [#548](https://github.com/getgrav/grav/issues/548) # v1.1.13 ## 01/17/2017 diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index d8b0a24a62..5cde949e31 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -575,6 +575,17 @@ form: validate: type: bool + cache.allow_webserver_gzip: + type: toggle + label: PLUGIN_ADMIN.ALLOW_WEBSERVER_GZIP + help: PLUGIN_ADMIN.ALLOW_WEBSERVER_GZIP_HELP + highlight: 0 + options: + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool + twig: type: section title: PLUGIN_ADMIN.TWIG_TEMPLATING diff --git a/system/config/system.yaml b/system/config/system.yaml index 7f7ba4baf5..1e54ae6a51 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -73,6 +73,7 @@ cache: prefix: 'g' # Cache prefix string (prevents cache conflicts) lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite) gzip: false # GZip compress the page output + allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event redis: socket: false # Path to redis unix socket (e.g. /var/run/redis/redis.sock), false = use server and port to connect diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index 44ca7d331a..3ca92d3c1c 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -306,7 +306,12 @@ public function shutdown() } else { // Without gzip we have no other choice than to prevent server from compressing the output. // This action turns off mod_deflate which would prevent us from closing the connection. - header('Content-Encoding: identity'); + if ($this['config']->get('system.cache.allow_webserver_gzip')) { + header('Content-Encoding: identity'); + } else { + header('Content-Encoding: none'); + } + } From c7fd01a64453a5f8dddef3072b55a1d529abe5ad Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 18 Jan 2017 15:12:14 -0700 Subject: [PATCH 3/3] Prepare for release --- CHANGELOG.md | 2 +- system/defines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bda03b8cc..65376376d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.1.14 -## XX/XX/2017 +## 01/18/2017 1. [](#bugfix) * Fixed `page.collection()` returning array and not Collection object when header variable did not exist diff --git a/system/defines.php b/system/defines.php index 9426009db8..8788f8d47a 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.1.13'); +define('GRAV_VERSION', '1.1.14'); define('GRAV_TESTING', false); define('DS', '/'); define('GRAV_PHP_MIN', '5.5.9');