-
-
Save pcrov/8850281697bcb517071b87c59a6809dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types = 1); | |
class simple_filter extends php_user_filter { | |
function filter($in, $out, &$consumed, $closing) { | |
while ($bucket = stream_bucket_make_writeable($in)) { | |
$consumed += $bucket->datalen; | |
stream_bucket_append($out, $bucket); | |
} | |
return PSFS_PASS_ON; | |
} | |
} | |
stream_filter_register("simple", "simple_filter"); | |
file_get_contents("php://filter/read=simple/resource=http://google.com"); | |
// Warning: file_get_contents(): Filter failed to process pre-buffered data in scratchpad.php on line 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment