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-- Bug #73944: Dictionary option of intflate_init() does not work --EXTENSIONS-- zli..

Decoded Output download

--TEST--
Bug #73944: Dictionary option of intflate_init() does not work
--EXTENSIONS--
zlib
--FILE--
<?php

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => str_repeat("", 32768)));
$a = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_1.data'));
echo '1 block: '.strlen($a).PHP_EOL;

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => $a));
$b = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_2.data'));
echo '2 block: '.($b === false ? 'failed' : strlen($b)).PHP_EOL;

?>
--EXPECT--
1 block: 32768
2 block: 32768

Did this file decode correctly?

Original Code

--TEST--
Bug #73944: Dictionary option of intflate_init() does not work
--EXTENSIONS--
zlib
--FILE--
<?php

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => str_repeat("\00", 32768)));
$a = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_1.data'));
echo '1 block: '.strlen($a).PHP_EOL;

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => $a));
$b = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_2.data'));
echo '2 block: '.($b === false ? 'failed' : strlen($b)).PHP_EOL;

?>
--EXPECT--
1 block: 32768
2 block: 32768

Function Calls

None

Variables

None

Stats

MD5 fc256cf5d5229077f16cc814f593084c
Eval Count 0
Decode Time 101 ms