diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/template.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php index 17d6294bc..1af735382 100644 --- a/inc/template.php +++ b/inc/template.php @@ -11,13 +11,18 @@ /** * Returns the path to the given template, uses - * default one if the custom version doesn't exist + * default one if the custom version doesn't exist. + * Also enables gzip compression if configured. * * @author Andreas Gohr <andi@splitbrain.org> */ function template($tpl){ global $conf; + if ($conf['gzip_output'] && extension_loaded('zlib') && preg_match('/gzip|deflate/', $_SERVER['HTTP_ACCEPT_ENCODING'])) { + ob_start('ob_gzhandler'); + } + if(@is_readable(DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl)) return DOKU_INC.'lib/tpl/'.$conf['template'].'/'.$tpl; |