mirror of
https://github.com/php/php-src.git
synced 2026-04-25 08:58:28 +02:00
90705d44e3
Always simply ignore (pass through) them. Previously the behavior depended on where the invalid character occurred, as it messed up the state management.
25 lines
617 B
PHP
25 lines
617 B
PHP
--TEST--
|
|
Test basename() function : usage variations with invalid paths
|
|
--SKIPIF--
|
|
<?php
|
|
if((substr(PHP_OS, 0, 3) == "WIN"))
|
|
die('skip not for Windows"');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
/* Prototype: string basename ( string $path [, string $suffix] );
|
|
Description: Given a string containing a path to a file,
|
|
this function will return the base name of the file.
|
|
If the filename ends in suffix this will also be cut off.
|
|
*/
|
|
|
|
setlocale(LC_CTYPE, "C");
|
|
var_dump(bin2hex(basename("\xff")));
|
|
var_dump(bin2hex(basename("a\xffb")));
|
|
|
|
echo "Done\n";
|
|
--EXPECT--
|
|
string(2) "ff"
|
|
string(6) "61ff62"
|
|
Done
|