Add second argument "entryname" to core/lib/Drupal/Core/Archiver/Zip.php add function to be used as local file name in zip archive instead of file path.

Created on 28 September 2022, about 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

PHP addFile function in zipArchive takes the second argument
'entryname' and use it to name file in the archive instead of file path. Drupal core/lib/Drupal/Core/Archiver/Zip.php add functionon on the other hand takes only one argument filepath and therefore use it to name files in archive.

Steps to reproduce

Use drupal plugin.manager.archiver and add function to create the zip archive. When you open the archive you will file path used to name the file inside the archive.
e.g /var/www/html/web/sites/default/files/yourfilename

Proposed resolution

Pass the second optional argument 'entryname' to override the filename in the archive https://www.php.net/manual/en/ziparchive.addfile.php

Remaining tasks

Testing

Feature request
Status

Needs work

Version

10.1

Component
Base 

Last updated about 2 hours ago

Created by

🇩🇪Germany majid.ali

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024