Index: trunk/phase3/includes/Linker.php |
— | — | @@ -221,11 +221,19 @@ |
222 | 222 | $query['action'] = 'edit'; |
223 | 223 | $query['redlink'] = '1'; |
224 | 224 | } |
225 | | - $ret = $target->getLocalURL( $query ); |
226 | | - if( $target->getFragment() !== '' ) { |
227 | | - $ret .= '#'.$target->getFragment(); |
| 225 | + # A couple of things to be concerned about here. First of all, |
| 226 | + # getLocalURL() ignores fragments. Second of all, if the Title is |
| 227 | + # *only* a fragment, it returns something like "/". |
| 228 | + if( $target->getFragment() === '' and $target->getPrefixedText() !== '' ) { |
| 229 | + return $target->getLocalURL( $query ); |
228 | 230 | } |
229 | | - return $ret; |
| 231 | + if( $target->getPrefixedText() === '' ) { |
| 232 | + # Just a fragment. There had better be one, anyway, or this is a |
| 233 | + # pretty silly Title. |
| 234 | + return '#'.$target->getFragment(); |
| 235 | + } |
| 236 | + # Then we must have a fragment *and* some Title text. |
| 237 | + return $target->getLocalURL( $query ).'#'.$target->getFragment(); |
230 | 238 | } |
231 | 239 | |
232 | 240 | private function linkAttribs( $target, $attribs, $options ) { |
— | — | @@ -1203,7 +1211,7 @@ |
1204 | 1212 | * |
1205 | 1213 | * @todo Document the $local parameter. |
1206 | 1214 | */ |
1207 | | - private function formatAutocomments( $comment, $title = NULL, $local = false ) { |
| 1215 | + private function formatAutocomments( $comment, $title = null, $local = false ) { |
1208 | 1216 | $match = array(); |
1209 | 1217 | while (preg_match('!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment,$match)) { |
1210 | 1218 | $pre=$match[1]; |
— | — | @@ -1222,7 +1230,7 @@ |
1223 | 1231 | $section = str_replace( '[[', '', $section ); |
1224 | 1232 | $section = str_replace( ']]', '', $section ); |
1225 | 1233 | if ( $local ) { |
1226 | | - $sectionTitle = Title::newFromText( '#' . $section); |
| 1234 | + $sectionTitle = Title::newFromText( '#' . $section ); |
1227 | 1235 | } else { |
1228 | 1236 | $sectionTitle = wfClone( $title ); |
1229 | 1237 | $sectionTitle->setFragment( $section ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -48,8 +48,6 @@ |
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 |
53 | | -* (bug 14997) Rollback links now work again |
54 | 52 | |
55 | 53 | === API changes in 1.14 === |
56 | 54 | |