From e8875a86be332b500c5f42cd66d009eb3641ea27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sun, 28 Jul 2013 13:10:57 +0200 Subject: [PATCH] MDL-40900 do not use 32bit unsigned integers 32bit PHP and any Windows PHP breaks otherwise. --- lib/filestorage/zip_archive.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/filestorage/zip_archive.php b/lib/filestorage/zip_archive.php index 6a5fa6ef353..4304c6ea618 100644 --- a/lib/filestorage/zip_archive.php +++ b/lib/filestorage/zip_archive.php @@ -318,10 +318,9 @@ class zip_archive extends file_archive { } if (substr($fileinfo->pathname, -9) === 'Thumbs.db') { $stream = $this->za->getStream($fileinfo->pathname); - $info = unpack('Nsiga/Nsigb', fread($stream, 8)); - $signature = fread($stream, 8); + $info = base64_encode(fread($stream, 8)); fclose($stream); - if ($info['siga'] === 0xd0cf11e0 && $info['sigb'] === 0xa1b11ae1) { + if ($info === '0M8R4KGxGuE=') { // It's an OLE Compound File - so it's almost certainly a Windows thumbnail cache. return true; }