php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #57718 getFromName and FL_NODIR troncate files
Submitted: 2007-06-24 15:38 UTC Modified: 2007-06-26 06:01 UTC
From: mangaii2 at yahoo dot fr Assigned: pajoye (profile)
Status: Closed Package: zip (PECL)
PHP Version: 5.1.6 OS: linux FC5
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: mangaii2 at yahoo dot fr
New email:
PHP Version: OS:

 

 [2007-06-24 15:38 UTC] mangaii2 at yahoo dot fr
Description:
------------
getFromName works but the data are troncated on some caracters (ex : 0xE0 , 0xE9 ... ) when used with FL_NODIR param. 

getFromName function and FL_NODIR param troncate the file on an accentuated caracter (in text file or extended caracter on binary file [ex : jpeg] / Caracters i have tested are 0xE0 and 0xE9 ). 

getFromName only works fine ...
getFromIndex and FL_NODIR works fine ...

System description :

OS : Linux FC5
PHP : php.i386   5.1.6-1.5
ZIP : php-pecl-zip.i386   1.8.10-1.fc5

All install with YUM and standart packages.

zip create by Winrar



Reproduce code:
---------------
$zip = new ZipArchive;
$res = $zip->open('test.zip',ZIPARCHIVE::CREATE);
if ($res === TRUE)
{
    $zip->addFromString('test.txt', 'd?d?');
    $zip->close();
    $res = $zip->open('test.zip');
    if ($res === TRUE)
    {
        echo $zip->getFromName( 'test.txt', ZIPARCHIVE::FL_NODIR );
        echo '<br />';
        echo $zip->getFromName( 'test.txt' );
        echo '<br />';
        $zip->close();
    }
}

Expected result:
----------------
d?d?

Actual result:
--------------
d?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-24 17:41 UTC] pierre dot php at gmail dot com
Confirmed, I can reproduce it here with latest cvs.

Thanks for the reproduce script
 [2007-06-24 17:49 UTC] pierre dot php at gmail dot com
Stupid me, it is a documentation error. Only the: ::FL_COMPRESSED and ::FL_UNCHANGED flags can be used. getFromIndex manual is correct.

I updated the docs, it will show up in the next manual build.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC