Index: trunk/phase3/includes/parser/LinkHolderArray.php |
— | — | @@ -144,6 +144,8 @@ |
145 | 145 | # Sort by namespace |
146 | 146 | ksort( $this->internals ); |
147 | 147 | |
| 148 | + $linkcolour_ids = array(); |
| 149 | + |
148 | 150 | # Generate query |
149 | 151 | $query = false; |
150 | 152 | $current = null; |
— | — | @@ -165,6 +167,7 @@ |
166 | 168 | } elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) { |
167 | 169 | $colours[$pdbk] = $sk->getLinkColour( $title, $threshold ); |
168 | 170 | $output->addLink( $title, $id ); |
| 171 | + $linkcolour_ids[$id] = $pdbk; |
169 | 172 | } elseif ( $linkCache->isBadLink( $pdbk ) ) { |
170 | 173 | $colours[$pdbk] = 'new'; |
171 | 174 | } else { |
— | — | @@ -191,7 +194,6 @@ |
192 | 195 | |
193 | 196 | # Fetch data and form into an associative array |
194 | 197 | # non-existent = broken |
195 | | - $linkcolour_ids = array(); |
196 | 198 | while ( $s = $dbr->fetchObject($res) ) { |
197 | 199 | $title = Title::makeTitle( $s->page_namespace, $s->page_title ); |
198 | 200 | $pdbk = $title->getPrefixedDBkey(); |
— | — | @@ -205,6 +207,8 @@ |
206 | 208 | $linkcolour_ids[$s->page_id] = $pdbk; |
207 | 209 | } |
208 | 210 | unset( $res ); |
| 211 | + } |
| 212 | + if ( count($linkcolour_ids) ) { |
209 | 213 | //pass an array of page_ids to an extension |
210 | 214 | wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) ); |
211 | 215 | } |