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: include_path with phar:// wrapper --EXTENSIONS-- phar --CONFLICTS-- tempman..
Decoded Output download
--TEST--
Phar: include_path with phar:// wrapper
--EXTENSIONS--
phar
--CONFLICTS--
tempmanifest1.phar.php
--INI--
phar.readonly=0
--FILE--
<?php
$fname = __DIR__ . '/tempmanifest1.phar.php';
$a = new Phar($fname);
$a['file1.php'] = 'file1.php
';
$a['test/file1.php'] = 'test/file1.php
';
unset($a);
set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname);
include 'file1.php';
set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname . '/test');
include 'file1.php';
include 'file2.php';
?>
--CLEAN--
<?php
@unlink(__DIR__ . '/tempmanifest1.phar.php');
?>
--EXPECTF--
file1.php
test/file1.php
Warning: include(file2.php): Failed to open stream: No such file or directory in %sinclude_path.php on line %d
Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d
Did this file decode correctly?
Original Code
--TEST--
Phar: include_path with phar:// wrapper
--EXTENSIONS--
phar
--CONFLICTS--
tempmanifest1.phar.php
--INI--
phar.readonly=0
--FILE--
<?php
$fname = __DIR__ . '/tempmanifest1.phar.php';
$a = new Phar($fname);
$a['file1.php'] = 'file1.php
';
$a['test/file1.php'] = 'test/file1.php
';
unset($a);
set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname);
include 'file1.php';
set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname . '/test');
include 'file1.php';
include 'file2.php';
?>
--CLEAN--
<?php
@unlink(__DIR__ . '/tempmanifest1.phar.php');
?>
--EXPECTF--
file1.php
test/file1.php
Warning: include(file2.php): Failed to open stream: No such file or directory in %sinclude_path.php on line %d
Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d
Function Calls
None |
Stats
MD5 | ae4088327b482babcf60a116d98d7890 |
Eval Count | 0 |
Decode Time | 82 ms |