We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83fadbd commit f7f137fCopy full SHA for f7f137f
src/Psr17/factory_helpers.php
@@ -123,6 +123,10 @@ function create_stream(string $content = ''):Stream{
123
function create_stream_from_input($in = null):StreamInterface{
124
$in = $in ?? '';
125
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!
130
if(is_string($in) && is_file($in) && is_readable($in)){
131
return new Stream(fopen($in, 'r'));
132
}
0 commit comments