Index: trunk/phase3/includes/Parser.php |
— | — | @@ -140,7 +140,10 @@ |
141 | 141 | $this->mStripState = array(); |
142 | 142 | $this->mArgStack = array(); |
143 | 143 | $this->mInPre = false; |
144 | | - $this->mInterwikiLinkHolders = array(); |
| 144 | + $this->mInterwikiLinkHolders = array( |
| 145 | + 'texts' => array(), |
| 146 | + 'titles' => array() |
| 147 | + ); |
145 | 148 | $this->mLinkHolders = array( |
146 | 149 | 'namespaces' => array(), |
147 | 150 | 'dbkeys' => array(), |
— | — | @@ -1423,8 +1426,8 @@ |
1424 | 1427 | list( $inside, $trail ) = Linker::splitTrail( $trail ); |
1425 | 1428 | |
1426 | 1429 | if ( $nt->isExternal() ) { |
1427 | | - $iwRecord = array( $nt->getPrefixedDBkey(), $prefix.$text.$inside ); |
1428 | | - $nr = array_push($this->mInterwikiLinkHolders, $iwRecord); |
| 1430 | + $nr = array_push( $this->mInterwikiLinkHolders['texts'], $prefix.$text.$inside ); |
| 1431 | + $this->mInterwikiLinkHolders['titles'][] =& $nt; |
1429 | 1432 | $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}"; |
1430 | 1433 | } else { |
1431 | 1434 | $nr = array_push( $this->mLinkHolders['namespaces'], $nt->getNamespace() ); |
— | — | @@ -2481,7 +2484,7 @@ |
2482 | 2485 | "\$this->mLinkHolders['texts'][\$1]", |
2483 | 2486 | $canonized_headline ); |
2484 | 2487 | $canonized_headline = preg_replace( '/<!--IWLINK ([0-9]*)-->/e', |
2485 | | - "\$this->mInterwikiLinkHolders[\$1][1]", |
| 2488 | + "\$this->mInterwikiLinkHolders['texts'][\$1]", |
2486 | 2489 | $canonized_headline ); |
2487 | 2490 | |
2488 | 2491 | # strip out HTML |
— | — | @@ -2985,13 +2988,13 @@ |
2986 | 2989 | |
2987 | 2990 | # Now process interwiki link holders |
2988 | 2991 | # This is quite a bit simpler than internal links |
2989 | | - if ( !empty( $this->mInterwikiLinkHolders ) ) { |
| 2992 | + if ( !empty( $this->mInterwikiLinkHolders['texts'] ) ) { |
2990 | 2993 | wfProfileIn( $fname.'-interwiki' ); |
2991 | 2994 | # Make interwiki link HTML |
2992 | 2995 | $wgOutputReplace = array(); |
2993 | | - foreach( $this->mInterwikiLinkHolders as $i => $lh ) { |
2994 | | - $s = $sk->makeLink( $lh[0], $lh[1] ); |
2995 | | - $wgOutputReplace[] = $s; |
| 2996 | + foreach( $this->mInterwikiLinkHolders['texts'] as $key => $link ) { |
| 2997 | + $title = $this->mInterwikiLinkHolders['titles'][$key]; |
| 2998 | + $wgOutputReplace[$key] = $sk->makeLinkObj( $title, $link ); |
2996 | 2999 | } |
2997 | 3000 | |
2998 | 3001 | $text = preg_replace_callback( |
— | — | @@ -3040,8 +3043,8 @@ |
3041 | 3044 | return $this->mLinkHolders['texts'][$key]; |
3042 | 3045 | } |
3043 | 3046 | } elseif( $type == 'IWLINK' ) { |
3044 | | - if( isset( $this->mInterwikiLinkHolders[$key][1] ) ) { |
3045 | | - return $this->mInterwikiLinkHolders[$key][1]; |
| 3047 | + if( isset( $this->mInterwikiLinkHolders['texts'][$key] ) ) { |
| 3048 | + return $this->mInterwikiLinkHolders['texts'][$key]; |
3046 | 3049 | } |
3047 | 3050 | } |
3048 | 3051 | return $matches[0]; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -238,6 +238,7 @@ |
239 | 239 | * (bug 2274) Respect stub threshold in category page list |
240 | 240 | * (bug 2173) Fatal error when removing an article with an empty title from the watchlist |
241 | 241 | * Removed -f parameter from mail() usage, likely to cause failures and bounces. |
| 242 | +* (bug 2130) Fixed interwiki links with fragments |
242 | 243 | |
243 | 244 | |
244 | 245 | === Caveats === |