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: test a zip archive created by unix "zip" command --EXTENSIONS-- phar --FILE..
Decoded Output download
--TEST--
Phar: test a zip archive created by unix "zip" command
--EXTENSIONS--
phar
--FILE--
<?php
$a = new PharData(__DIR__ . '/files/zip.zip');
foreach ($a as $b) {
if ($b->isDir()) {
echo "dir " . $b->getPathName() . "
";
} else {
echo $b->getPathName(), "
";
echo file_get_contents($b->getPathName()), "
";
}
}
if (isset($a['notempty/hi.txt'])) {
echo $a['notempty/hi.txt']->getPathName() . "
";
}
?>
--EXPECTF--
dir phar://%s/zip.zip%cempty
phar://%s/zip.zip%chi.txt
hi there
dir phar://%s/zip.zip%cnotempty
phar://%s/zip.zip/notempty%chi.txt
Did this file decode correctly?
Original Code
--TEST--
Phar: test a zip archive created by unix "zip" command
--EXTENSIONS--
phar
--FILE--
<?php
$a = new PharData(__DIR__ . '/files/zip.zip');
foreach ($a as $b) {
if ($b->isDir()) {
echo "dir " . $b->getPathName() . "\n";
} else {
echo $b->getPathName(), "\n";
echo file_get_contents($b->getPathName()), "\n";
}
}
if (isset($a['notempty/hi.txt'])) {
echo $a['notempty/hi.txt']->getPathName() . "\n";
}
?>
--EXPECTF--
dir phar://%s/zip.zip%cempty
phar://%s/zip.zip%chi.txt
hi there
dir phar://%s/zip.zip%cnotempty
phar://%s/zip.zip/notempty%chi.txt
Function Calls
None |
Stats
MD5 | 428b92d3fb13c806d27aa5305d1f53de |
Eval Count | 0 |
Decode Time | 69 ms |