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
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: 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

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: Thu Mar 28 14:01:29 2024 UTC