Permalink
Browse files

Bug fix in the system that exclude external links.

  • Loading branch information...
1 parent 3bae684 commit 8a9a270568df17df7fbd019b6b65bebd147aa483 @Tpt Tpt committed Mar 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 book/BookProvider.php
View
@@ -325,7 +325,7 @@ public function getMetadata($id) {
* @return array|Page
*/
public function getChaptersList($title) {
- $list = $this->xPath->query('//*[@id="ws-summary"]/descendant::html:a[not(contains(@title,":"))][not(contains(@href,"action=edit"))]');
+ $list = $this->xPath->query('//*[@id="ws-summary"]/descendant::html:a[not(contains(@title,":"))][not(contains(@href,"action=edit"))][not(contains(@class,"extiw"))][not(contains(@class,"external"))]');
$chapters = array();
if($list->length != 0) {
foreach($list as $link) {
@@ -335,7 +335,7 @@ public function getChaptersList($title) {
$chapters[] = $chapter;
}
} else {
- $list = $this->xPath->query('//html:a[contains(@href,"' . Api::mediawikiUrlEncode($title) . '")][contains(@href,"wikisource.org")][not(contains(@href,"#"))][not(contains(@href,":"))][not(contains(@href,"action=edit"))][not(contains(@title,"/Texte entier"))]');
+ $list = $this->xPath->query('//html:a[contains(@href,"' . Api::mediawikiUrlEncode($title) . '")][not(contains(@class,"extiw"))][not(contains(@class,"external"))][not(contains(@href,"#"))][not(contains(@href,":"))][not(contains(@href,"action=edit"))][not(contains(@title,"/Texte entier"))]');
foreach($list as $link) {
$chapter = new Page();
$chapter->title = str_replace(' ', '_', $link->getAttribute('title'));

0 comments on commit 8a9a270

Please sign in to comment.