Explorar o código

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

stealth35 %!s(int64=13) %!d(string=hai) anos
pai
achega
bca551e86f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php

+ 1 - 1
src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php

@@ -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;