File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -183,14 +183,27 @@ private function mapFiles(&$files)
183183 if (UPLOAD_ERR_OK == $ file ->getError ()) {
184184 file_put_contents ($ tmpname , (string )$ file ->getStream ());
185185 }
186- $ file = new SymfonyFile (
187- $ tmpname ,
188- $ file ->getClientFilename (),
189- $ file ->getClientMediaType (),
190- $ file ->getSize (),
191- $ file ->getError (),
192- true
193- );
186+ $ class = new \ReflectionClass (SymfonyFile::class);
187+ if (count ($ class ->getConstructor ()->getParameters ()) === 6 ) {
188+ // Symfony < v4.1
189+ $ file = new SymfonyFile (
190+ $ tmpname ,
191+ $ file ->getClientFilename (),
192+ $ file ->getClientMediaType (),
193+ $ file ->getSize (),
194+ $ file ->getError (),
195+ true
196+ );
197+ } else {
198+ $ file = new SymfonyFile (
199+ $ tmpname ,
200+ $ file ->getClientFilename (),
201+ $ file ->getClientMediaType (),
202+ $ file ->getError (),
203+ true
204+ );
205+ }
206+
194207 }
195208 }
196209 }
You can’t perform that action at this time.
0 commit comments