From 9e70f64d44f7ffcc03bdbbd8c312b52f97d33c7b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 22 Jul 2012 15:38:23 +0200 Subject: [PATCH] Fix oc-1163: gzdecode function not always defined This function is only found in newer php versions --- lib/minimizer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/minimizer.php b/lib/minimizer.php index 3bf5ff9980..3dc89e331a 100644 --- a/lib/minimizer.php +++ b/lib/minimizer.php @@ -46,3 +46,13 @@ abstract class OC_Minimizer { echo $out; } } + +if (!function_exists('gzdecode')) { + function gzdecode($data,$maxlength=null,&$filename='',&$error='') + { + if (strcmp(substr($data,0,9),"\x1f\x8b\x8\0\0\0\0\0\0")) { + return null; // Not the GZIP format we expect (See RFC 1952) + } + return gzinflate(substr($data,10,-8)); + } +}