diff --git a/inc/school.crawl.inc b/inc/school.crawl.inc --- a/inc/school.crawl.inc +++ b/inc/school.crawl.inc @@ -484,7 +484,7 @@ function school_crawl_form(DOMElement $f $form = array(); $xpath = new DOMXPath($form_node->ownerDocument); - foreach ($xpath->query('input', $form_node) as $input_node) + foreach ($xpath->query('.//input', $form_node) as $input_node) { if ($input_node->hasAttribute('name')) { @@ -507,14 +507,14 @@ function school_crawl_form(DOMElement $f } } - foreach ($xpath->query('select', $form_node) as $select_node) + foreach ($xpath->query('.//select', $form_node) as $select_node) { if ($select_node->hasAttribute('name')) { $select_name = $select_node->getAttribute('name'); if (!isset($form[$select_name])) $form[$select_name] = array(); - foreach ($xpath->query('option[selected]', $select_node) as $option_node) + foreach ($xpath->query('.//option[@selected]', $select_node) as $option_node) if ($option_node->hasAttribute('value')) $form[$select_name][] = $option_node->getAttribute('value'); } @@ -536,28 +536,32 @@ function school_crawl_form(DOMElement $f * \param $selected * Will be set to an array of the currently selected keys if passed. * \return - * An associative array mapping an