Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1219,13 +1219,10 @@ |
1220 | 1220 | if ( $local ) { |
1221 | 1221 | $sectionTitle = Title::newFromText( '#' . $section ); |
1222 | 1222 | } else { |
1223 | | - $sectionTitle = clone( $title ); |
1224 | | - $sectionTitle->mFragment = $section; |
| 1223 | + $sectionTitle = Title::makeTitleSafe( $title->getNamespace(), |
| 1224 | + $title->getDBkey(), $section ); |
1225 | 1225 | } |
1226 | | - # FIXME: $sectionTitle should probably always be valid at this |
1227 | | - # point, but in some scenarios it's not (bug 15351). Is this cor- |
1228 | | - # rect? |
1229 | | - if( $title instanceof Title ) { |
| 1226 | + if ( $sectionTitle ) { |
1230 | 1227 | $link = $this->link( $sectionTitle, |
1231 | 1228 | wfMsgForContent( 'sectionlink' ), array(), array(), |
1232 | 1229 | 'noclasses' ); |