Index: tests/Zend/Search/Lucene/DocumentTest.php =================================================================== --- tests/Zend/Search/Lucene/DocumentTest.php (revision 20177) +++ tests/Zend/Search/Lucene/DocumentTest.php (working copy) @@ -171,6 +171,34 @@ 'contributing.html')); } + /** + * @group ZF-8740 + */ + public function testHtmlAreaTags() + { + $html = '' + . 'Page title' + . '' + . 'Document body.' + . 'some image' + . '' + . 'Link 3' + . 'Link 4' + . '' + . 'Link 1.' + . 'Link 1.' + . '' + . ''; + + $oldNoFollowValue = Zend_Search_Lucene_Document_Html::getExcludeNoFollowLinks(); + + Zend_Search_Lucene_Document_Html::setExcludeNoFollowLinks(false); + $doc1 = Zend_Search_Lucene_Document_Html::loadHTML($html); + $this->assertTrue($doc1 instanceof Zend_Search_Lucene_Document_Html); + $links = array('link1.html', 'link2.html', 'link3.html', 'link4.html'); + $this->assertTrue(array_values($doc1->getLinks()) == $links); + } + public function testHtmlNoFollowLinks() { $html = '' Index: library/Zend/Search/Lucene/Document/Html.php =================================================================== --- library/Zend/Search/Lucene/Document/Html.php (revision 20177) +++ library/Zend/Search/Lucene/Document/Html.php (working copy) @@ -157,6 +157,16 @@ } $this->_links = array_unique($this->_links); + $linkNodes = $this->_doc->getElementsByTagName('area'); + foreach ($linkNodes as $linkNode) { + if (($href = $linkNode->getAttribute('href')) != '' && + (!self::$_excludeNoFollowLinks || strtolower($linkNode->getAttribute('rel')) != 'nofollow' ) + ) { + $this->_links[] = $href; + } + } + $this->_links = array_unique($this->_links); + $linkNodes = $xpath->query('/html/head/link'); foreach ($linkNodes as $linkNode) { if (($href = $linkNode->getAttribute('href')) != '') {