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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jalal at spread-it dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 00:00:03 2025 UTC