php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51685 dirname() returns part of query string parsing a URL containing a slash
Submitted: 2010-04-28 19:37 UTC Modified: 2010-04-28 19:44 UTC
From: shepard dot dl at gmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.3.2 OS: Linux
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: shepard dot dl at gmail dot com
New email:
PHP Version: OS:

 

 [2010-04-28 19:37 UTC] shepard dot dl at gmail dot com
Description:
------------
If a url that contains a slash (/) is passed to dirname(), dirname() returns 
everything up to the slash in the query string.

Test script:
---------------
$dirname = "web/index.php?url=pages/test.php";
print dirname($dirname);

Expected result:
----------------
application/pages

Actual result:
--------------
application/pages/index.php?url=pages

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-28 19:42 UTC] shepard dot dl at gmail dot com
I made a mistake in the description. It should read: "If a url with a query string 
that contains a slash (/) is passed to dirname(), dirname() returns everything up 
to the slash in the query string."
 [2010-04-28 19:44 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-04-28 19:44 UTC] pajoye@php.net
Use parse_url if you like to parse URL.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 03:01:27 2024 UTC