php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64498 $phar->buildFromDirectory can't compress file with an accent in its name
Submitted: 2013-03-23 23:18 UTC Modified: 2014-04-21 00:26 UTC
Votes:9
Avg. Score:4.3 ± 0.8
Reproduced:9 of 9 (100.0%)
Same Version:4 (44.4%)
Same OS:4 (44.4%)
From: david dot vantyghem at free dot fr Assigned: stas (profile)
Status: Closed Package: PHAR related
PHP Version: 5.4Git-2013-03-23 (Git) OS: 3.5.0-17-generic #28-Ubuntu SMP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david dot vantyghem at free dot fr
New email:
PHP Version: OS:

 

 [2013-03-23 23:18 UTC] david dot vantyghem at free dot fr
Description:
------------
---
From manual page: http://www.php.net/phardata.buildfromiterator
---

I want to compress a directory into a zip file.

If the letter "é" (or another letter with an accent) is in the filename of one of the compressed files, the $phar->buildFromDirectory fails with a fatal error.

Test script:
---------------
$phar = new PharData("file.zip");
$phar->buildFromDirectory("directory");

Expected result:
----------------
A file.zip file should be created.

Actual result:
--------------
No file is created, I've got this error :

Fatal error: Uncaught exception 'BadMethodCallException' with message 'Entry Cliquez ici pour démarrer COMPILIBRE.bat cannot be created: phar error: invalid path "Cliquez ici pour démarrer COMPILIBRE.bat" contains illegal character' in /home/david/Documents/logiciels/COMPILIBRE/TEST-COMPILIBRE/compilation.php:265 Stack trace: #0 /home/david/Documents/logiciels/COMPILIBRE/TEST-COMPILIBRE/compilation.php(265): PharData->buildFromDirectory('compilations/27...') #1 {main} thrown in /home/david/Documents/logiciels/COMPILIBRE/TEST-COMPILIBRE/compilation.php on line 265

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-21 00:26 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2014-04-21 00:26 UTC] stas@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

merged as ea4cee93c82496e3d1c4db1d69930f9fca85eb8b
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jan 28 23:01:28 2025 UTC