PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Tools and Utilities » MIME_Type » Bug #2078

_fileAutoDetect should pass file in quotes

Details

Submitted2004-08-07 09:31 UTC
Fromscragz at hotmail dot com
Assignedieure
StatusClosed
PackageMIME_Type
PHP Version4.3.4
OSDebian Sarge
Roadmaps(Not assigned)

Comments

[2004-08-07 09:31 UTC] scragz at hotmail dot com

Description:
------------
Files with a space in the name that would otherwise detect fine fail because the call to System_Command::pushCommand does not put the filename in quotes.

Reproduce code:
---------------
<?php
MIME_Type::autoDetect('/tmp/some file');
// gives "/tmp/some: cannot open '/tmp/some' (No such file or directory)" error
?>

The solution is to change line ~382 to:
$cmd->pushCommand($fileCmd, "-bi '{$file}'");