[DomCrawler] ChoiceFormField should take the content when value is unavailable

This commit is contained in:
stealth35 2011-09-20 19:08:17 +03:00
parent b635dcad7a
commit bca551e86f

View File

@ -207,7 +207,7 @@ class ChoiceFormField extends FormField
$found = false;
foreach ($this->xpath->query('descendant::option', $this->node) as $option) {
$this->options[] = $option->getAttribute('value');
$this->options[] = $option->hasAttribute('value') ? $option->getAttribute('value') : $option->nodeValue;
if ($option->getAttribute('selected')) {
$found = true;