1--TEST--
2Stream: RFC2397 with corrupt? payload
3--INI--
4allow_url_fopen=1
5--FILE--
6<?php
7
8$streams = array(
9    "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==",
10    "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==",
11    'data:;base64,#Zm9vYmFyIGZvb2Jhcg==',
12    'data:;base64,#Zm9vYmFyIGZvb2Jhc=',
13    );
14
15foreach($streams as $stream)
16{
17    try {
18        var_dump(file_get_contents($stream));
19    } catch (ValueError $e) {
20        echo $e->getMessage(), "\n";
21    }
22}
23
24?>
25--EXPECTF--
26file_get_contents(): Argument #1 ($filename) must not contain any null bytes
27file_get_contents(): Argument #1 ($filename) must not contain any null bytes
28
29Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhcg==): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d
30bool(false)
31
32Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d
33bool(false)
34