Skip to content

Instantly share code, notes, and snippets.

@do-aki
Created March 16, 2016 01:36
Show Gist options
  • Save do-aki/c09ca3a198be26c6c5f5 to your computer and use it in GitHub Desktop.
Save do-aki/c09ca3a198be26c6c5f5 to your computer and use it in GitHub Desktop.
<?php
require 'vendor/autoload.php';
use Symfony\Component\DomCrawler\Crawler;
$html = <<<'HTML'
<!doctype html>
<form>
<input type="image" name="date[2016-03-16]" />
</form>
HTML;
$c = new Crawler($html, "http://example.com/");
$c->filter('input[type="image"]')->form();
// Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Malformed field path "date[2016-03-16].x"' in /tmp/sample/vendor/symfony/dom-crawler/FormFieldRegistry.php on line 213
// InvalidArgumentException: Malformed field path "date[2016-03-16].x" in /tmp/sample/vendor/symfony/dom-crawler/FormFieldRegistry.php on line 213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment