浏览代码

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

stealth35 13 年之前
父节点
当前提交
bca551e86f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;