From 9c140a681e9e4412586d24b5d68dbc729beeb80b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0koda?= Date: Wed, 12 Mar 2014 16:04:36 +0800 Subject: [PATCH] MDL-44300 force PHP 5.6.x to return raw file names for our own guessing --- lib/filestorage/zip_archive.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/filestorage/zip_archive.php b/lib/filestorage/zip_archive.php index 8a995a1cd05..b346311be3a 100644 --- a/lib/filestorage/zip_archive.php +++ b/lib/filestorage/zip_archive.php @@ -263,7 +263,9 @@ class zip_archive extends file_archive { return false; } - $result = $this->za->statIndex($index); + // PHP 5.6 introduced encoding guessing logic, we need to fall back + // to raw ZIP_FL_ENC_RAW (== 64) to get consistent results as in PHP 5.5. + $result = $this->za->statIndex($index, 64); if ($result === false) { return false; -- 2.43.0