Bug #79736 [Csd->ReO]: ZipArchive

From: Date: Thu, 25 Jun 2020 18:52:07 +0000
Subject: Bug #79736 [Csd->ReO]: ZipArchive
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227672@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79736&edit=1

 ID:                 79736
 Updated by:         requinix@php.net
 Reported by:        edultra at gmail dot com
 Summary:            ZipArchive
-Status:             Closed
+Status:             Re-Opened
 Type:               Bug
 Package:            *Compression related
 Operating System:   Windows and Linux
 PHP Version:        7.2.31
-Assigned To:        peehaa
+Assigned To:        
 Block user comment: N
 Private report:     N

 New Comment:

When you use ziparchive to zip a folder with
subfolders and files on a windows server it creates the file, however
decompression on a Linux server the files are all wrong,
from what I was able to discover is due to the position of the bar that it does
for windows example:

the folder on windows contains the following structure / files:

index.html
images
image1.jpg
image2.jpg
image3.jpg
styles
style.css
content
home.html
chapter.html
footer.html

From what I saw he saves the way to decompress
index.html
images \ image1.jpg
images \ image2.jpg
images \ image3.jpg
styles \ style.css
content \ home.html
content \ chapter.html
content \ footer.html

See that the position in the windows of the bar is \ however in this position the
php interprets that it is to disregard the next character getting
so the paths in linux:
index.html
images \ mage1.jpg
images \ mage2.jpg
images \ mage3.jpg
styles \ tyle.css
content \ ome.html
content \ apitulo.html
content \ ooter.html

The root files are successfully extracted but the others generate
all wrong files.

Expected result:
----------------
That the files are extracted correctly both those generated in the
windows and extracted in linux and vice versa.

Actual result:
--------------
The files are extracted all with problem.


Previous Comments:
------------------------------------------------------------------------
[2020-06-25 18:49:05] peehaa@php.net

Non English.

If you think this is a valid bug report feel free to submit it again in English.

------------------------------------------------------------------------
[2020-06-25 18:45:33] edultra at gmail dot com

Description:
------------
Quando você utiliza o ziparchive para criar um zip de uma pasta com subpastas e arquivos em um
servidor windows ele cria o arquivo, porém na descompressão em um servidor Linux os arquivos
ficam todos errados, pelo que consegui descobrir é devido a posição da barra que ele faz
para o windows exemplo:

a pasta no windows contém a seguinte estrutura/arquivos:

index.html
images
    image1.jpg
    image2.jpg
    image3.jpg
styles
    style.css
content
    home.html
    capitulo.html
    footer.html

Pelo que vi ele salva o caminho para despois descomprimir
index.html
images\image1.jpg
images\image2.jpg
images\image3.jpg
styles\style.css
content\home.html
content\capitulo.html
content\footer.html

Vejam que a posição no windows da barra é \ porém nesta posição o php interpreta
que é para desconsiderar o próximo caracter ficando assim os caminhos no linux:
index.html
images\mage1.jpg
images\mage2.jpg
images\mage3.jpg
styles\tyle.css
content\ome.html
content\apitulo.html
content\ooter.html

Os arquivos na raiz são extrai dos com sucesso mas os outros geram arquivos todos errados.

Expected result:
----------------
Que os arquivos sejam extrai dos corretamente tanto os gerados no windows e extraidos no linux e
vice-versa.

Actual result:
--------------
Os arquivos são extraidos todos com problema.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79736&edit=1


Thread (4 messages)

« previous php.bugs (#227672) next »