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 realpath() with relative paths --FILE-- <?php $file_path = __DIR__; @mkdir("..
Decoded Output download
--TEST--
Test realpath() with relative paths
--FILE--
<?php
$file_path = __DIR__;
@mkdir("$file_path/realpath_basic4/home/test", 0777, true);
@symlink("$file_path/realpath_basic4/home", "$file_path/realpath_basic4/link1");
@symlink("$file_path/realpath_basic4/link1", "$file_path/realpath_basic4/link2");
echo "1. " . realpath("$file_path/realpath_basic4/link2") . "
";
echo "2. " . realpath("$file_path/realpath_basic4/link2/test") . "
";
?>
--CLEAN--
<?php
$file_path = __DIR__;
unlink("$file_path/realpath_basic4/link2");
unlink("$file_path/realpath_basic4/link1");
rmdir("$file_path/realpath_basic4/home/test");
rmdir("$file_path/realpath_basic4/home");
rmdir("$file_path/realpath_basic4");
?>
--EXPECTF--
1. %s%erealpath_basic4%ehome
2. %s%erealpath_basic4%ehome%etest
Did this file decode correctly?
Original Code
--TEST--
Test realpath() with relative paths
--FILE--
<?php
$file_path = __DIR__;
@mkdir("$file_path/realpath_basic4/home/test", 0777, true);
@symlink("$file_path/realpath_basic4/home", "$file_path/realpath_basic4/link1");
@symlink("$file_path/realpath_basic4/link1", "$file_path/realpath_basic4/link2");
echo "1. " . realpath("$file_path/realpath_basic4/link2") . "\n";
echo "2. " . realpath("$file_path/realpath_basic4/link2/test") . "\n";
?>
--CLEAN--
<?php
$file_path = __DIR__;
unlink("$file_path/realpath_basic4/link2");
unlink("$file_path/realpath_basic4/link1");
rmdir("$file_path/realpath_basic4/home/test");
rmdir("$file_path/realpath_basic4/home");
rmdir("$file_path/realpath_basic4");
?>
--EXPECTF--
1. %s%erealpath_basic4%ehome
2. %s%erealpath_basic4%ehome%etest
Function Calls
None |
Stats
MD5 | 4ec57875611d3037542fa599f7b726a0 |
Eval Count | 0 |
Decode Time | 79 ms |