Skip to content

Commit 645285c

Browse files
committed
Merge branch 'release/1.1.14'
2 parents b5b452e + c7fd01a commit 645285c

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v1.1.14
2+
## 01/18/2017
3+
4+
1. [](#bugfix)
5+
* Fixed `page.collection()` returning array and not Collection object when header variable did not exist
6+
* 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)
7+
18
# v1.1.13
29
## 01/17/2017
310

system/blueprints/config/system.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,17 @@ form:
575575
validate:
576576
type: bool
577577

578+
cache.allow_webserver_gzip:
579+
type: toggle
580+
label: PLUGIN_ADMIN.ALLOW_WEBSERVER_GZIP
581+
help: PLUGIN_ADMIN.ALLOW_WEBSERVER_GZIP_HELP
582+
highlight: 0
583+
options:
584+
1: PLUGIN_ADMIN.YES
585+
0: PLUGIN_ADMIN.NO
586+
validate:
587+
type: bool
588+
578589
twig:
579590
type: section
580591
title: PLUGIN_ADMIN.TWIG_TEMPLATING

system/config/system.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ cache:
7373
prefix: 'g' # Cache prefix string (prevents cache conflicts)
7474
lifetime: 604800 # Lifetime of cached data in seconds (0 = infinite)
7575
gzip: false # GZip compress the page output
76+
allow_webserver_gzip: false # If true, `content-encoding: identity` but connection isn't closed before `onShutDown()` event
7677
redis:
7778
socket: false # Path to redis unix socket (e.g. /var/run/redis/redis.sock), false = use server and port to connect
7879

system/defines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// Some standard defines
1010
define('GRAV', true);
11-
define('GRAV_VERSION', '1.1.13');
11+
define('GRAV_VERSION', '1.1.14');
1212
define('GRAV_TESTING', false);
1313
define('DS', '/');
1414
define('GRAV_PHP_MIN', '5.5.9');

system/src/Grav/Common/Grav.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,12 @@ public function shutdown()
306306
} else {
307307
// Without gzip we have no other choice than to prevent server from compressing the output.
308308
// This action turns off mod_deflate which would prevent us from closing the connection.
309-
header('Content-Encoding: identity');
309+
if ($this['config']->get('system.cache.allow_webserver_gzip')) {
310+
header('Content-Encoding: identity');
311+
} else {
312+
header('Content-Encoding: none');
313+
}
314+
310315
}
311316

312317

system/src/Grav/Common/Page/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ public function collection($params = 'content', $pagination = true)
22882288
}
22892289

22902290
if (!isset($params['items'])) {
2291-
return [];
2291+
return new Collection();
22922292
}
22932293

22942294
$collection = $this->evaluate($params['items']);

0 commit comments

Comments
 (0)