dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8cc3404
)
patch for bug 22981 : pass cached links to the extension hook too.
author
ThomasV
<thomasv@users.mediawiki.org>
Mon, 14 Jun 2010 13:22:21 +0000
(13:22 +0000)
committer
ThomasV
<thomasv@users.mediawiki.org>
Mon, 14 Jun 2010 13:22:21 +0000
(13:22 +0000)
includes/parser/LinkHolderArray.php
patch
|
blob
|
history
diff --git
a/includes/parser/LinkHolderArray.php
b/includes/parser/LinkHolderArray.php
index
17cffe8
..
37c1387
100644
(file)
--- a/
includes/parser/LinkHolderArray.php
+++ b/
includes/parser/LinkHolderArray.php
@@
-144,6
+144,8
@@
class LinkHolderArray {
# Sort by namespace
ksort( $this->internals );
# Sort by namespace
ksort( $this->internals );
+ $linkcolour_ids = array();
+
# Generate query
$query = false;
$current = null;
# Generate query
$query = false;
$current = null;
@@
-165,6
+167,7
@@
class LinkHolderArray {
} elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
$colours[$pdbk] = $sk->getLinkColour( $title, $threshold );
$output->addLink( $title, $id );
} elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
$colours[$pdbk] = $sk->getLinkColour( $title, $threshold );
$output->addLink( $title, $id );
+ $linkcolour_ids[$id] = $pdbk;
} elseif ( $linkCache->isBadLink( $pdbk ) ) {
$colours[$pdbk] = 'new';
} else {
} elseif ( $linkCache->isBadLink( $pdbk ) ) {
$colours[$pdbk] = 'new';
} else {
@@
-191,7
+194,6
@@
class LinkHolderArray {
# Fetch data and form into an associative array
# non-existent = broken
# Fetch data and form into an associative array
# non-existent = broken
- $linkcolour_ids = array();
while ( $s = $dbr->fetchObject($res) ) {
$title = Title::makeTitle( $s->page_namespace, $s->page_title );
$pdbk = $title->getPrefixedDBkey();
while ( $s = $dbr->fetchObject($res) ) {
$title = Title::makeTitle( $s->page_namespace, $s->page_title );
$pdbk = $title->getPrefixedDBkey();
@@
-205,6
+207,8
@@
class LinkHolderArray {
$linkcolour_ids[$s->page_id] = $pdbk;
}
unset( $res );
$linkcolour_ids[$s->page_id] = $pdbk;
}
unset( $res );
+ }
+ if ( count($linkcolour_ids) ) {
//pass an array of page_ids to an extension
wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
}
//pass an array of page_ids to an extension
wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
}