php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49190 PharData::convertToExecutable does not recognize filenames with multiple dots
Submitted: 2009-08-07 14:23 UTC Modified: 2009-09-05 21:58 UTC
From: alexander dot wahl at netclusive dot com Assigned:
Status: Not a bug Package: PHAR related
PHP Version: 5.3.0 OS: Linux 2.6.26-2-amd64
Private report: No CVE-ID: None
 [2009-08-07 14:23 UTC] alexander dot wahl at netclusive dot com
Description:
------------
PharData::convertToExecutable does not recognize filenames with multiple 
dots, while creating the new archive. Everything from the first dot is 
ignored.


Reproduce code:
---------------
<?php
try {
	$oTarPhar = new PharData(realpath('test.one.two.tar'), Phar::NONE, '.tar');
	$oTarPhar->convertToExecutable(Phar::PHAR, Phar::NONE, '.phar');
} catch (Exception $e) {
	echo $e->getMessage();
}
?>

Expected result:
----------------
A new PHAR archive with the expected filename: 

test.one.two.phar

Actual result:
--------------
A new PHAR archive with the filename: 

test.phar

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-07 14:25 UTC] alexander dot wahl at netlusive dot com
email typo
 [2009-08-07 14:26 UTC] alexander dot wahl at netclusive dot com
email typo
 [2009-09-05 21:58 UTC] cellog@php.net
<?php
try {
	$oTarPhar = new PharData(realpath('test.one.two.tar'), Phar::NONE,
'.tar');
	$oTarPhar->convertToExecutable(Phar::PHAR, Phar::NONE, '.one.two.phar');
} catch (Exception $e) {
	echo $e->getMessage();
}
?>

will do what you desire.

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 17:01:23 2020 UTC