Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Bug #14621 unmodifyName mangles filename
Submitted: 2008-09-08 20:47 UTC
From: sharoncorrell Assigned:
Status: Open Package: File_Archive (version 1.5.4)
PHP Version: 5.2.5 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2008-09-08 20:47 UTC] sharoncorrell (Sharon Correll)
Description: ------------ When I run Directory::unmodifyName in some circumstances, the results seem obviously incorrect. My input is: $this->oldBaseName = "importtest.tar" $this->newBaseName = "" $name = "ssproto-data-1220394271.xml" The value returned is "importtest.tar/sproto-data-1220394271.xml". Notice that the first character of the original filename ($name = "ssproto-data-1220394271.xml") has been deleted. I don't really know how to patch it because I don't understand the purpose of this code: substr($name, strlen($this->newBaseName)+1) The file "ssproto-data-1220394271.xml" is one of the files embedded in "importtest.tar". The high level code looks like this: $zip_reader = File_Archive::read( "importtest.tar" . "/" ); $xml_writer = File_Archive::toVariable( $result ); $zip_reader->extractFile("ssproto-data-1220394271.xml", $xml_writer); The embedded file has no path information attached.

Comments

 [2008-09-08 22:01 UTC] sharoncorrell (Sharon Correll)
Ooops, correction, the class in question in File_Archive_Reader_ChangeName_Directory.