Bug #67361 [Com]: copy() fails on filename with newline
| From: | tux at krageroby dot no | Date: | Wed, 18 Jun 2014 08:23:55 +0000 |
| Subject: | Bug #67361 [Com]: copy() fails on filename with newline | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186233@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67361&edit=1
ID: 67361
Comment by: tux at krageroby dot no
Reported by: tux at krageroby dot no
Summary: copy() fails on filename with newline
Status: Open
Type: Bug
Package: Filesystem function related
Operating System: xUbuntu
PHP Version: 5.5.13
Block user comment: N
Private report: N
New Comment:
Yes, this bug occurs when the filename contains a real windows newline in the filename. so, if using
single quotes, the result is file not found. The bug in my case occurs when unpacking files from a
.zip file that has a windows newline in the filename.
Previous Comments:
------------------------------------------------------------------------
[2014-06-18 01:21:09] husman85 at gmail dot com
The reason why this fails is because you have escape sequences wrapped in double quotes. If you try
the same thing with single quotes, then you will notice this function is working properly. Escape
sequences are parsed in the context of double quotes.
------------------------------------------------------------------------
[2014-05-30 06:46:49] tux at krageroby dot no
Description:
------------
When trying to use php copy() function on a file with a newline character in the filename, it fails
to open stream.
Test script:
---------------
php -r 'copy("filename_with\r\nNewline_character", "/tmp/copytest");'
Actual result:
--------------
php -r 'copy("filename_with\r\nNewline_character", "/tmp/copytest");'
PHP Warning: copy(filename_with
Newline_character): failed to open stream: No such file or directory in Command line code on line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67361&edit=1