Prechádzať zdrojové kódy

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

stealth35 13 rokov pred
rodič
commit
bca551e86f

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