diff options
Diffstat (limited to 'ext/phar/zip.c')
-rw-r--r-- | ext/phar/zip.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/phar/zip.c b/ext/phar/zip.c index c52e87647d..b6e50d572a 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -829,6 +829,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ zend_off_t offset; int not_really_modified = 0; p = (struct _phar_zip_pass*) arg; + uint16_t general_purpose_flags; if (entry->is_mounted) { return ZEND_HASH_APPLY_KEEP; @@ -878,6 +879,11 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ memcpy(central.datestamp, local.datestamp, sizeof(local.datestamp)); PHAR_SET_16(central.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); PHAR_SET_16(local.filename_len, entry->filename_len + (entry->is_dir ? 1 : 0)); + // set language encoding flag (all filenames have to be UTF-8 anyway) + general_purpose_flags = PHAR_GET_16(central.flags); + PHAR_SET_16(central.flags, general_purpose_flags | (1 << 11)); + general_purpose_flags = PHAR_GET_16(local.flags); + PHAR_SET_16(local.flags, general_purpose_flags | (1 << 11)); PHAR_SET_32(central.offset, php_stream_tell(p->filefp)); /* do extra field for perms later */ |