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 #43522 (stream_get_line() eats additional characters) --FILE-- <?php // 12345..
Decoded Output download
--TEST--
Bug #43522 (stream_get_line() eats additional characters)
--FILE--
<?php // 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
$fp = fopen(__FILE__, 'r'); // Open self
DoTest($fp, 'ZZZ'); // test multi-char delimiter
DoTest($fp, "Z"); // test single-char delimiter
function DoTest($fp, $delim) {
echo "Delimiter: " . $delim . "
";
rewind($fp);
echo " " . stream_get_line($fp, 10, $delim) . "
";
echo " " . stream_get_line($fp, 10, $delim) . "
";
}
?>
--EXPECT--
Delimiter: ZZZ
<?php // 1
234567890A
Delimiter: Z
<?php // 1
234567890A
?>
Did this file decode correctly?
Original Code
--TEST--
Bug #43522 (stream_get_line() eats additional characters)
--FILE--
<?php // 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
$fp = fopen(__FILE__, 'r'); // Open self
DoTest($fp, 'ZZZ'); // test multi-char delimiter
DoTest($fp, "Z"); // test single-char delimiter
function DoTest($fp, $delim) {
echo "Delimiter: " . $delim . "\n";
rewind($fp);
echo "\t" . stream_get_line($fp, 10, $delim) . "\n";
echo "\t" . stream_get_line($fp, 10, $delim) . "\n";
}
?>
--EXPECT--
Delimiter: ZZZ
<?php // 1
234567890A
Delimiter: Z
<?php // 1
234567890A
Function Calls
None |
Stats
MD5 | a98e4b0b80eb7f87a258051492651bf2 |
Eval Count | 0 |
Decode Time | 103 ms |