diff --git a/CHANGELOG.md b/CHANGELOG.md index 426449e00..65376376d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.1.14 +## 01/18/2017 + +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 d8b0a24a6..5cde949e3 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 7f7ba4baf..1e54ae6a5 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/defines.php b/system/defines.php index 9426009db..8788f8d47 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'); diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index 44ca7d331..3ca92d3c1 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -306,7 +306,12 @@ class Grav extends Container } 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'); + } + } diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 013a3ab32..fdd976e2f 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2288,7 +2288,7 @@ class Page } if (!isset($params['items'])) { - return []; + return new Collection(); } $collection = $this->evaluate($params['items']);