Index: trunk/phase3/includes/Linker.php |
— | — | @@ -159,7 +159,9 @@ |
160 | 160 | * @param $options mixed String or array of strings: |
161 | 161 | * 'known': Page is known to exist, so don't check if it does. |
162 | 162 | * 'broken': Page is known not to exist, so don't check if it does. |
163 | | - * 'noclasses': Don't add any classes automatically (includes "new", "stub", "mw-redirect"). Only use the class attribute provided, if any. |
| 163 | + * 'noclasses': Don't add any classes automatically (includes "new", |
| 164 | + * "stub", "mw-redirect"). Only use the class attribute provided, if |
| 165 | + * any. |
164 | 166 | * @return string HTML <a> attribute |
165 | 167 | */ |
166 | 168 | public function link( $target, $text = null, $customAttribs = array(), $query = array(), $options = array() ) { |
— | — | @@ -218,8 +220,11 @@ |
219 | 221 | $query['action'] = 'edit'; |
220 | 222 | $query['redlink'] = '1'; |
221 | 223 | } |
222 | | - |
223 | | - return $target->getLocalURL( wfArrayToCGI( $query ) ); |
| 224 | + $ret = $target->getLocalURL( $query ); |
| 225 | + if( $target->getFragment() !== '' ) { |
| 226 | + $ret .= '#'.$target->getFragment(); |
| 227 | + } |
| 228 | + return $ret; |
224 | 229 | } |
225 | 230 | |
226 | 231 | private function linkAttribs( $target, $attribs, $options ) { |
— | — | @@ -1219,7 +1224,7 @@ |
1220 | 1225 | $sectionTitle = Title::newFromText( '#' . $section); |
1221 | 1226 | } else { |
1222 | 1227 | $sectionTitle = wfClone( $title ); |
1223 | | - $sectionTitle->mFragment = $section; |
| 1228 | + $sectionTitle->setFragment( $section ); |
1224 | 1229 | } |
1225 | 1230 | $link = $this->link( $sectionTitle, wfMsgForContent( 'sectionlink' ) ); |
1226 | 1231 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -745,14 +745,19 @@ |
746 | 746 | * Get a real URL referring to this title, with interwiki link and |
747 | 747 | * fragment |
748 | 748 | * |
749 | | - * @param string $query an optional query string, not used |
750 | | - * for interwiki links |
| 749 | + * @param array $query an optional query string, not used for interwiki |
| 750 | + * links. Can be specified as an associative array as well, e.g., |
| 751 | + * array( 'action' => 'edit' ) (keys and values will be URL-escaped). |
751 | 752 | * @param string $variant language variant of url (for sr, zh..) |
752 | 753 | * @return string the URL |
753 | 754 | */ |
754 | 755 | public function getFullURL( $query = '', $variant = false ) { |
755 | 756 | global $wgContLang, $wgServer, $wgRequest; |
756 | 757 | |
| 758 | + if( is_array( $query ) ) { |
| 759 | + $query = wfArrayToCGI( $query ); |
| 760 | + } |
| 761 | + |
757 | 762 | if ( '' == $this->mInterwiki ) { |
758 | 763 | $url = $this->getLocalUrl( $query, $variant ); |
759 | 764 | |
— | — | @@ -784,8 +789,10 @@ |
785 | 790 | /** |
786 | 791 | * Get a URL with no fragment or server name. If this page is generated |
787 | 792 | * with action=render, $wgServer is prepended. |
788 | | - * @param string $query an optional query string; if not specified, |
789 | | - * $wgArticlePath will be used. |
| 793 | + * @param mixed $query an optional query string; if not specified, |
| 794 | + * $wgArticlePath will be used. Can be specified as an associative array |
| 795 | + * as well, e.g., array( 'action' => 'edit' ) (keys and values will be |
| 796 | + * URL-escaped). |
790 | 797 | * @param string $variant language variant of url (for sr, zh..) |
791 | 798 | * @return string the URL |
792 | 799 | */ |
— | — | @@ -793,6 +800,10 @@ |
794 | 801 | global $wgArticlePath, $wgScript, $wgServer, $wgRequest; |
795 | 802 | global $wgVariantArticlePath, $wgContLang, $wgUser; |
796 | 803 | |
| 804 | + if( is_array( $query ) ) { |
| 805 | + $query = wfArrayToCGI( $query ); |
| 806 | + } |
| 807 | + |
797 | 808 | // internal links should point to same variant as current page (only anonymous users) |
798 | 809 | if($variant == false && $wgContLang->hasVariants() && !$wgUser->isLoggedIn()){ |
799 | 810 | $pref = $wgContLang->getPreferredVariant(false); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -48,6 +48,7 @@ |
49 | 49 | * Recursion loop check added to Categoryfinder class |
50 | 50 | * Fixed few performance troubles of large job queue processing |
51 | 51 | * Not setting various parameters in Foreign Repos now fails more gracefully |
| 52 | +* (bug 14995) Some link fragments in the interface stopped appearing |
52 | 53 | |
53 | 54 | === API changes in 1.14 === |
54 | 55 | |