- # Fetch data and form into an associative array
- # non-existent = broken
- # 1 = known
- # 2 = stub
- $colours = array();
- while ( $s = $dbr->fetchObject($res) ) {
- $key = $s->cur_namespace . ' ' . $s->cur_title;
- if ( $threshold > 0 ) {
- $size = $s->cur_len;
- if ( $s->cur_is_redirect || $s->cur_namespace != 0 || $length < $threshold ) {
- $colours[$key] = 1;
+ $res = $dbr->query( $query, $fname );
+
+ # Fetch data and form into an associative array
+ # non-existent = broken
+ # 1 = known
+ # 2 = stub
+ while ( $s = $dbr->fetchObject($res) ) {
+ $title = Title::makeTitle( $s->cur_namespace, $s->cur_title );
+ $pdbk = $title->getPrefixedDBkey();
+ $wgLinkCache->addGoodLink( $s->cur_id, $pdbk );
+
+ if ( $threshold > 0 ) {
+ $size = $s->cur_len;
+ if ( $s->cur_is_redirect || $s->cur_namespace != 0 || $length < $threshold ) {
+ $colours[$pdbk] = 1;
+ } else {
+ $colours[$pdbk] = 2;
+ }