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-- recursive mkdir() with unclean paths --FILE-- <?php chdir(__DIR__); $dirpath = "...

Decoded Output download

--TEST--
recursive mkdir() with unclean paths
--FILE--
<?php
chdir(__DIR__);
$dirpath = "./tmp/foo//bar/logs";
mkdir($dirpath, 0777, true);

if (is_dir($dirpath)) {
    echo "Ok.
";
} else {
    echo "Failed.
";
}
rmdir("./tmp/foo/bar/logs");
rmdir("./tmp/foo/bar/");
rmdir("./tmp/foo/");
rmdir("./tmp/");
?>
--EXPECT--
Ok.

Did this file decode correctly?

Original Code

--TEST--
recursive mkdir() with unclean paths
--FILE--
<?php
chdir(__DIR__);
$dirpath = "./tmp/foo//bar/logs";
mkdir($dirpath, 0777, true);

if (is_dir($dirpath)) {
    echo "Ok.\n";
} else {
    echo "Failed.\n";
}
rmdir("./tmp/foo/bar/logs");
rmdir("./tmp/foo/bar/");
rmdir("./tmp/foo/");
rmdir("./tmp/");
?>
--EXPECT--
Ok.

Function Calls

None

Variables

None

Stats

MD5 fb2ff9559bcedced7e7a82dc3e1e64e4
Eval Count 0
Decode Time 103 ms