Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test basename() function : usage variations with invalid paths --SKIPIF-- <?php i..

Decoded Output download

--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
setlocale(LC_CTYPE, "C");
var_dump(bin2hex(basename("")));
var_dump(bin2hex(basename("ab")));

echo "Done
";
?>
--EXPECT--
string(2) "ff"
string(6) "61ff62"
Done

Did this file decode correctly?

Original Code

--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
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

Function Calls

None

Variables

None

Stats

MD5 ef2f147524d2a0678a94ec6f2bf58c72
Eval Count 0
Decode Time 93 ms