php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36855 is_dir and opendir + path ending with space
Submitted: 2006-03-25 03:54 UTC Modified: 2006-04-09 22:32 UTC
From: r21vo1 at gmail dot com Assigned: pollita (profile)
Status: Not a bug Package: Directory function related
PHP Version: 5.1.2 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: r21vo1 at gmail dot com
New email:
PHP Version: OS:

 

 [2006-03-25 03:54 UTC] r21vo1 at gmail dot com
Description:
------------
is_dir() doesn't fail if path ends with additional space, opendir does.

Reproduce code:
---------------
create dir, for example "bla"
var_dump(is_dir("bla "));
var_dump(opendir("bla "));

Expected result:
----------------
Both should be either true or false.

Actual result:
--------------
is_dir() returns true, opendir() returns false.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-25 12:15 UTC] bjori@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip

Can't reproduce
 [2006-03-25 12:58 UTC] r21vo1 at gmail dot com
Tested, problem remains.
I also tested on my freebsd box with php 5.1.2, works correctly (both values false).
 [2006-03-26 00:47 UTC] tony2001@php.net
Sara, please take a look at it.
Looks like a windows weirdness, but I'm unable to test it.
 [2006-04-09 22:32 UTC] edink@php.net
This is an oddity of win32 api, and not a bug in PHP.

Try this on command line and you will see this strange behaviour is a "feature" of the operating system.

md test
cd "test "

Windows happily complies with it.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 02:01:23 2020 UTC