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-- Bug #70903 scandir wrongly interprets the Turkish "" character --SKIPIF-- <?php i..
Decoded Output download
--TEST--
Bug #70903 scandir wrongly interprets the Turkish "" character
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();
?>
--FILE--
<?php
/* This file is in UTF-8. */
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
$prefix = __DIR__ . DIRECTORY_SEPARATOR . "testBug70903" . DIRECTORY_SEPARATOR;
$d0 = $prefix . "";
mkdir($prefix);
mkdir($d0);
get_basename_with_cp($d0, 65001);
touch("$d0\.txt");
var_dump(count(stat("$d0\.txt")) > 0);
unlink("$d0\.txt");
rmdir($d0);
rmdir($prefix);
?>
--EXPECTF--
Active code page: 65001
getting basename of %s\u0131
string(2) ""
bool(true)
string(%d) "%s\u0131"
Active code page: %d
bool(true)
Did this file decode correctly?
Original Code
--TEST--
Bug #70903 scandir wrongly interprets the Turkish "" character
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();
?>
--FILE--
<?php
/* This file is in UTF-8. */
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
$prefix = __DIR__ . DIRECTORY_SEPARATOR . "testBug70903" . DIRECTORY_SEPARATOR;
$d0 = $prefix . "";
mkdir($prefix);
mkdir($d0);
get_basename_with_cp($d0, 65001);
touch("$d0\\.txt");
var_dump(count(stat("$d0\\.txt")) > 0);
unlink("$d0\\.txt");
rmdir($d0);
rmdir($prefix);
?>
--EXPECTF--
Active code page: 65001
getting basename of %s\
string(2) ""
bool(true)
string(%d) "%s\"
Active code page: %d
bool(true)
Function Calls
None |
Stats
MD5 | e92c253a3ed3e692246e360520ac83c9 |
Eval Count | 0 |
Decode Time | 91 ms |