php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38189 pathinfo can't handle relative path /dir/subdir1/../subdir2/file.ext
Submitted: 2006-07-22 17:40 UTC Modified: 2006-07-23 09:50 UTC
From: jalal at spread-it dot org Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.4.2 OS: Fedora Core 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 18 = ?
Subscribe to this entry?

 
 [2006-07-22 17:40 UTC] jalal at spread-it dot org
Description:
------------
pathinfo() can't handle relative path like /dir/subdir1/../subdir2/file.ext

Reproduce code:
---------------
$path_parts = pathinfo('/dir/subdir1/../subdir2/file.ext');
print_r($path_parts);

Expected result:
----------------
Array ( 
[dirname] => /dir/subdir2
[basename] => index.html 
[extension] => html
)

Actual result:
--------------
Array ( 
[dirname] => /dir/subdir1/../subdir2
[basename] => index.html 
[extension] => html
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-23 09:50 UTC] mike@php.net
pathinfo() does not do any normalization, ist's just a string function.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 17:01:29 2024 UTC