Bug #67593 [Com]: Path in require or include that has C:\e...\script.php

From: Date: Tue, 08 Jul 2014 23:03:31 +0000
Subject: Bug #67593 [Com]: Path in require or include that has C:\e...\script.php
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186540@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67593&edit=1

 ID:                 67593
 Comment by:         abanarn at gmail dot com
 Reported by:        abanarn at gmail dot com
 Summary:            Path in require or include that has
                     C:\e...\script.php
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Windows
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

I figured I will have to update the code to use what suggested. Thanks for confirming. Cheers


Previous Comments:
------------------------------------------------------------------------
[2014-07-08 20:15:01] requinix@php.net

Yup. \e was added in 5.4.0.

Moral of the story is to not use unescaped backslashes in double-quoted strings. Escape them, or use
single-quoted strings, or use forward slashes because those work just fine even in Windows.

------------------------------------------------------------------------
[2014-07-08 18:32:12] abanarn at gmail dot com

If directory name starts with letter 'e' include or require will complain

------------------------------------------------------------------------
[2014-07-08 18:29:32] abanarn at gmail dot com

Description:
------------
Recently, I have been working on upgrading my php5.3 in my Windows servers. I have noticed that some
of the includes are failing because the path name has \e for example : C:\epo\example.php and it
thinks that "\e" is an escape code for ESC.

No issues in <= php-5.4.3

In php >= 5.4.4; I received the below:

<?php
require(C:\epo\example.php)
?>
Warning: require(C:←po\example.php): failed to open stream: In
valid argument in C:\php\db_connection.php on line 20

Fatal error: require(): Failed opening required 'C:←po\example.php'

Test script:
---------------
<?php
require(C:\epo\example.php)
?>



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67593&edit=1


Thread (4 messages)

« previous php.bugs (#186540) next »