Skip to content

Commit f7f137f

Browse files
committed
⚠️ you have been warned.
1 parent 83fadbd commit f7f137f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Psr17/factory_helpers.php

+4
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ function create_stream(string $content = ''):Stream{
123123
function create_stream_from_input($in = null):StreamInterface{
124124
$in = $in ?? '';
125125

126+
// not sure about this one, it might cause:
127+
// a) trouble if the given string accidentally matches a file path, and
128+
// b) security implications because of the above.
129+
// use with caution and never with user input!
126130
if(is_string($in) && is_file($in) && is_readable($in)){
127131
return new Stream(fopen($in, 'r'));
128132
}

0 commit comments

Comments
 (0)