commit 675aa79da6435e666b5fa50ce9cd7dd2cf21622e
parent 727e374bb141274b4217195c1d1e05f27b1e702a
Author: dankert <devnull@localhost>
Date: Sat, 6 Feb 2010 03:08:01 +0100
Abfragen auf korrekten Gzip-Header
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/actionClasses/FileAction.class.php b/actionClasses/FileAction.class.php
@@ -408,6 +408,15 @@ class FileAction extends ObjectAction
case 'gz':
if ( $this->getRequestVar('replace') )
{
+ if ( strcmp(substr($this->file->loadValue(),0,2),"\x1f\x8b"))
+ {
+ Http::serverError("Not GZIP format (See RFC 1952)");
+ }
+ $method = ord(substr($this->file->loadValue(),2,1));
+ if ( $method != 8 )
+ {
+ Http::serverError("Unknown GZIP method: $method");
+ }
$this->file->value = gzinflate( substr($this->file->loadValue(),10));
$this->file->parse_filename( $this->file->filename );
$this->file->save();