php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30105 Error of the function "basename()"
Submitted: 2004-09-16 07:44 UTC Modified: 2005-03-20 18:04 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: lp at zy165 dot com Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 5.0.1 OS: Linux 9
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: lp at zy165 dot com
New email:
PHP Version: OS:

 

 [2004-09-16 07:44 UTC] lp at zy165 dot com
Description:
------------
I am Chinese. I love linux, php very much.
So I do many things using php.
But tody, i find an error of the function "basename()"
so that i can't continue writing code by php.
The error like this:
if the $path in function basename($path) contain the Chinese, then the result will be error.
The error appears only in php-5.0.1, before the version it works normally.
Please e-mail me after you see the letter, thank you very much.

Reproduce code:
---------------
<?php
$path="/home/httpd/??/??/??.php";
//Here the $path means "/home/httpd/I/Love/You.php",and "I love you" is translated to Chinese.
$str1=basename ($path,".php");
$str2=basename ($path);
echo $path."<br>1:".$str1."<br>2:".$str2;

$path2="/home/httpd/??/Love/??";
$str3=basename ($path2);
echo "<br><br>".$path2."<br>3:".$str3;

$path3="/home/httpd/I/Love/??";
$str4=basename ($path3);
echo "<br><br>".$path3."<br>4:".$str4;
?>

Expected result:
----------------
/home/httpd/??/??/??.php
1:??
2:??.php

/home/httpd/??/Love/??
3:??

/home/httpd/I/Love/??
4:??

Actual result:
--------------
/home/httpd/??/??/??.php
1:.php
2:.php

/home/httpd/??/Love/??
3:Love

/home/httpd/I/Love/??
4:Love


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-16 08:09 UTC] ppmm at wuxinan dot net
http://bugs.php.net/bug.php?id=29542
please refer to bug 29542. I am the reporter of that bug. I MISTAKENLY gave the report that this bug has been fixed in 5.0.1, resulting bug 29542 being closed. This bug has NOT been fixed in 5.0.1, and not in snapshot either.

Additional information: this bug does not exist on my English windows xp server, but DOES exist on my Chinese windows 2k server. I tried xp with 5.0.1 and didn't find problem, so mistakenly reported it has been fixed. sorry. Seems like this problem is related to non-unicode/unicode platform issue.
 [2005-03-07 21:16 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-20 18:04 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 23:01:24 2020 UTC