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-- Phar: rmdir test --EXTENSIONS-- phar --INI-- phar.readonly=0 phar.require_hash=0 ..
Decoded Output download
--TEST--
Phar: rmdir test
--EXTENSIONS--
phar
--INI--
phar.readonly=0
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
$files = array();
$files['a/x'] = 'a';
include 'files/phar_test.inc';
include $fname;
echo file_get_contents($pname . '/a/x') . "
";
var_dump(rmdir($pname . '/a'));
echo file_get_contents($pname . '/a/x') . "
";
unlink($pname . '/a/x');
var_dump(rmdir($pname . '/a'));
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
a
Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line 14
bool(false)
a
bool(true)
Did this file decode correctly?
Original Code
--TEST--
Phar: rmdir test
--EXTENSIONS--
phar
--INI--
phar.readonly=0
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>";
$files = array();
$files['a/x'] = 'a';
include 'files/phar_test.inc';
include $fname;
echo file_get_contents($pname . '/a/x') . "\n";
var_dump(rmdir($pname . '/a'));
echo file_get_contents($pname . '/a/x') . "\n";
unlink($pname . '/a/x');
var_dump(rmdir($pname . '/a'));
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
a
Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line 14
bool(false)
a
bool(true)
Function Calls
None |
Stats
MD5 | 48f71e21d02e9eaf8a27de3a58c225ba |
Eval Count | 0 |
Decode Time | 77 ms |