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
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: alexander dot wahl at netclusive dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 11:01:31 2025 UTC