From 2020498bd573c6fa2e5aacbcefee281bfc49796f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 14 Jan 2021 21:45:28 +0100 Subject: [PATCH] MDL-70631 files: Replace hard-coded value with FL_ENC_RAW constant This is not related to the issue but I noticed it while trying to debug it. Back when this line was introduced in 9c140a681e9, the ZipArchive had not yet exposed this flag as a constant. It was added later with PHP 7.0.8 and we can switch to using it now. --- lib/filestorage/zip_archive.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/filestorage/zip_archive.php b/lib/filestorage/zip_archive.php index 7b1438c7fa0..beff0510bad 100644 --- a/lib/filestorage/zip_archive.php +++ b/lib/filestorage/zip_archive.php @@ -292,9 +292,9 @@ class zip_archive extends file_archive { return false; } - // 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); + // PHP 5.6 introduced encoding guessing logic for file names. To keep consistent behaviour with older versions, + // we fall back to obtaining file names as raw unmodified strings. + $result = $this->za->statIndex($index, ZipArchive::FL_ENC_RAW); if ($result === false) { return false;