Closed fisharebest closed 3 years ago
I have an HTML form with an optional <input type="file"> field.
<input type="file">
There is no problem with PHP 7.1-7.4, but with PHP 8.0 I get the following error.
Uncaught ValueError: Path cannot be empty in /Users/gr4376/Projects/webtrees/vendor/nyholm/psr7/src/Factory/Psr17Factory.php:40 Stack trace: #0 .../vendor/nyholm/psr7/src/Factory/Psr17Factory.php(40): fopen('', 'r') #1 .../vendor/nyholm/psr7-server/src/ServerRequestCreator.php(216): Nyholm\Psr7\Factory\Psr17Factory->createStreamFromFile('') #2 .../vendor/nyholm/psr7-server/src/ServerRequestCreator.php(188): Nyholm\Psr7Server\ServerRequestCreator->createUploadedFileFromSpec(Array) #3 .../vendor/nyholm/psr7-server/src/ServerRequestCreator.php(98): Nyholm\Psr7Server\ServerRequestCreator->normalizeFiles(Array) #4 .../vendor/nyholm/psr7-server/src/ServerRequestCreator.php(71): Nyholm\Psr7Server\ServerRequestCreator->fromArrays(Array, Array, Array, Array, Array, Array, Resource id #7) #5 .../index.php(55): Nyholm\Psr7Server\ServerRequestCreator->fromGlobals()
This is because fopen('') gives a warning in PHP <=7.4, but a fatal error in PHP 8.0.
fopen('')
See https://3v4l.org/cgYav
Oops - raised against wrong project.
See https://github.com/Nyholm/psr7/issues/175
I have an HTML form with an optional
<input type="file">
field.There is no problem with PHP 7.1-7.4, but with PHP 8.0 I get the following error.
This is because
fopen('')
gives a warning in PHP <=7.4, but a fatal error in PHP 8.0.See https://3v4l.org/cgYav