From:             lp at zy165 dot com
Operating system: Linux 9
PHP version:      5.0.1
PHP Bug Type:     Directory function related
Bug description:  Error of the function "basename()"

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


-- 
Edit bug report at http://bugs.php.net/?id=30105&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30105&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30105&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30105&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30105&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30105&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30105&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30105&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30105&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30105&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30105&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30105&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30105&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30105&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30105&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30105&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30105&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30105&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30105&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30105&r=mysqlcfg

Reply via email to