php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29690 pathinfo() reports wrong directory name
Submitted: 2004-08-15 22:54 UTC Modified: 2004-10-21 22:18 UTC
From: ressourceweb at hotmail dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.0.0 OS: Windows XP Home Edition
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: ressourceweb at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-08-15 22:54 UTC] ressourceweb at hotmail dot com
Description:
------------
Steps to reproduce the problem :
 - Apache HTTPd Server 2.0.50
 - PHP 5.0.0
 - MultiViews ENABLED

Trying to use the pathinfo($SCRIPT_FILENAME); command on a script called using double slashes in the URL (like http://localhost/php/test/pathinfo/argument/http//url) will return wrong directory information

Reproduce code:
---------------
<?php
/*
 * File name : pathinfo.php
 * Directory : /php/test/
 * Script filename : /php/test/pathinfo.php
 * Called in browser the following way :
 * http://localhost/php/test/pathinfo/argument/http//url
 */

$pathdata=pathinfo($SCRIPT_FILENAME);
echo $pathdata["dirname"];
?>

Expected result:
----------------
/php/test/

Actual result:
--------------
/php/test/argument/http//

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-16 17:09 UTC] ressourceweb at hotmail dot com
First of all, my bug report example should have been
<?php
$pathdata=pathinfo($SCRIPT_NAME);
echo $pathdata["dirname"];
?>
instead of
<?php
$pathdata=pathinfo($SCRIPT_FILENAME);
echo $pathdata["dirname"];
?>

also, i noticed that the pathinfo() function behaves correctly. it is the variable SCRIPT_NAME that contains wrong information
 [2004-10-21 22:18 UTC] jorton@php.net
This is not a PHP issue, see: http://issues.apache.org/bugzilla/show_bug.cgi?id=10775
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 09:01:31 2024 UTC