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 #76859 (stream_get_line skips data if used with filters) --FILE-- <?php $dat..

Decoded Output download

--TEST--
Bug #76859 (stream_get_line skips data if used with filters)
--FILE--
<?php

$data = '123';

$fh = fopen('php://memory', 'r+b');
fwrite($fh, $data);
rewind($fh);
stream_filter_append($fh, 'string.rot13', STREAM_FILTER_READ);

$out = '';
while (!feof($fh)) {
    $out .= stream_get_line($fh, 1024);
}

fclose($fh);

echo strlen($out) . "
";
?>
--EXPECT--
3

Did this file decode correctly?

Original Code

--TEST--
Bug #76859 (stream_get_line skips data if used with filters)
--FILE--
<?php

$data = '123';

$fh = fopen('php://memory', 'r+b');
fwrite($fh, $data);
rewind($fh);
stream_filter_append($fh, 'string.rot13', STREAM_FILTER_READ);

$out = '';
while (!feof($fh)) {
    $out .= stream_get_line($fh, 1024);
}

fclose($fh);

echo strlen($out) . "\n";
?>
--EXPECT--
3

Function Calls

fopen 1
fwrite 1

Variables

$fh True
$data 123

Stats

MD5 2b2c3886dc9bf010542f33930d5bce10
Eval Count 0
Decode Time 85 ms