Fix oc-1163: gzdecode function not always defined

This function is only found in newer php versions
This commit is contained in:
Bart Visscher 2012-07-22 15:38:23 +02:00
parent b1010160b3
commit 9e70f64d44
1 changed files with 10 additions and 0 deletions

View File

@ -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));
}
}