Bug #74641 [Com]: Escaping a digit on directory name
| From: | spam2 at rhsoft dot net | Date: | Wed, 24 May 2017 11:42:22 +0000 |
| Subject: | Bug #74641 [Com]: Escaping a digit on directory name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209246@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74641&edit=1
ID: 74641
Comment by: spam2 at rhsoft dot net
Reported by: falzone at outlook dot com
Summary: Escaping a digit on directory name
Status: Not a bug
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows 10
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
or to explain it better:
"\\3" don't escape the digit
it escapes the backslash itself and it needs to be escaped within ""
you can use even on windows a normal / for a path
Previous Comments:
------------------------------------------------------------------------
[2017-05-24 11:35:00] ab@php.net
Thanks for the report. Literals in double quotes extrapolate escape sequences, please consult the
manual.
Thanks.
------------------------------------------------------------------------
[2017-05-24 00:21:00] falzone at outlook dot com
Description:
------------
---
From manual page: http://www.php.net/function.move-uploaded-file
---
Test script:
---------------
move_uploaded_file($_FILES["file"]["tmp_name"], "G:\WEB
Servers\UwAmp\www\3_KachiVersiaPurva\uploads\\" . $_FILES["file"]["name"]);
Expected result:
----------------
I expect to upload a file in this directory. When i escape it like this: "G:\WEB
Servers\UwAmp\www\\3_KachiVersiaPurva\uploads\\" it's working like a charm. Why i should
escape digit (3 in my case). It isn't backslash or so
Actual result:
--------------
Warning: move_uploaded_file(G:\WEB
Servers\UwAmp\www_KachiVersiaPurva\uploads\05.11.2016.peak_temperature.gif): failed to open stream:
No such file or directory in G:\WEB Servers\UwAmp\www\3_KachiVersiaPurva\image.php on line 32
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74641&edit=1