Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #24141 [DomCrawler] Fix conversion to int on GetPhpFiles (MaraBlaga)
This PR was merged into the 2.7 branch. Discussion ---------- [DomCrawler] Fix conversion to int on GetPhpFiles | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | We've encountered that when using the DomCrawler with the UploadedFile, everything gets converted into strings. We've addressed the issue, and made sure that the attributes in the UploadedFile respects their type. The code below demonstrates the problem. ```<?php require 'vendor/autoload.php'; require 'app/AppKernel.php'; $crawler = new \Symfony\Component\DomCrawler\Crawler( '<form method="post"><input type="file" name="image"/></form>', 'http://www.example.com' ); $form = $crawler->filter('form')->form(); $form['image'] = new \Symfony\Component\HttpFoundation\File\UploadedFile( 'path/to/file', 'foo', 'text/plain', 100 ); $client = new \Symfony\Bundle\FrameworkBundle\Client(new AppKernel('test', true)); $crawler = $client->submit($form); var_dump($client->getRequest()->files->get('image')->getClientSize()); //returns string, not int echo 'Done.' . PHP_EOL; Commits ------- 122da5a [DomCrawler] Fix conversion to int on GetPhpFiles
- Loading branch information