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 #81302 (Stream position after stream filter removed) --EXTENSIONS-- zlib --FI..
Decoded Output download
--TEST--
Bug #81302 (Stream position after stream filter removed)
--EXTENSIONS--
zlib
--FILE--
<?php
$f = fopen("php://memory", "w+b");
$z = stream_filter_append($f, "zlib.deflate", STREAM_FILTER_WRITE, 6);
fwrite($f, "Testing");
stream_filter_remove($z);
$pos = ftell($f);
fseek($f, 0);
$count = strlen(fread($f, 1024));
fclose($f);
var_dump($count === $pos);
?>
--EXPECT--
bool(true)
Did this file decode correctly?
Original Code
--TEST--
Bug #81302 (Stream position after stream filter removed)
--EXTENSIONS--
zlib
--FILE--
<?php
$f = fopen("php://memory", "w+b");
$z = stream_filter_append($f, "zlib.deflate", STREAM_FILTER_WRITE, 6);
fwrite($f, "Testing");
stream_filter_remove($z);
$pos = ftell($f);
fseek($f, 0);
$count = strlen(fread($f, 1024));
fclose($f);
var_dump($count === $pos);
?>
--EXPECT--
bool(true)
Function Calls
fopen | 1 |
Stats
MD5 | 2977d3b1ab34a7274b78c21e9c086b9d |
Eval Count | 0 |
Decode Time | 77 ms |