diff options
| author | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-18 17:51:23 +0200 | 
|---|---|---|
| committer | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-18 17:51:23 +0200 | 
| commit | c78744d4f8a0cfad7ca5aa3d2867fb66d4c6b8c4 (patch) | |
| tree | e2b4d5d066590a966d949409cb48104456edaf7e /modules/gallery/libraries/Gallery_View.php | |
| parent | 7f5030ac208c30a7dc576a57cd9e665022ccbde5 (diff) | |
| parent | df22832a5b7e7c1962940becab1c90aaec3392f9 (diff) | |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/libraries/Gallery_View.php')
| -rw-r--r-- | modules/gallery/libraries/Gallery_View.php | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 133066d7..31231ca6 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -73,6 +73,10 @@ class Gallery_View_Core extends View {    protected function combine_files($files, $type) {      $links = array(); +    if (empty($files)) { +      return; +    } +      // Include the url in the cache key so that if the Gallery moves, we don't use old cached      // entries.      $key = array(url::abs_file("")); @@ -104,7 +108,10 @@ class Gallery_View_Core extends View {        }        $cache->set($key, $contents, array($type), 30 * 84600); -      if (function_exists("gzencode")) { + +      $use_gzip = function_exists("gzencode") && +        (int) ini_get("zlib.output_compression") === 0; +      if ($use_gzip) {          $cache->set("{$key}_gz", gzencode($contents, 9, FORCE_GZIP),                      array($type, "gzip"), 30 * 84600);        } | 
