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.
This commit is contained in:
David Mudrák 2021-01-14 21:45:28 +01:00
parent b227b6ea45
commit 6109e8b272

View File

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