return true;
}
+ # Check for a suppression tag (used e.g. in periodically archived discussions)
+ $mw = MagicWord::get( 'staticredirect' );
+ if ( $mw->match( $text ) ) {
+ wfDebug( __METHOD__.": skipping: suppressed with __STATICREDIRECT__\n" );
+ return true;
+ }
+
# Find the current final destination
$newTitle = self::getFinalDestination( $this->redirTitle );
if ( !$newTitle ) {
wfDebug( __METHOD__.": skipping, already good\n" );
}
+ # Preserve fragment (bug 14904)
+ $newTitle = Title::makeTitle( $newTitle->getNamespace(), $newTitle->getDBkey(),
+ $currentDest->getFragment() );
+
# Fix the text
# Remember that redirect pages can have categories, templates, etc.,
# so the regex has to be fairly general
$newText = preg_replace( '/ \[ \[ [^\]]* \] \] /x',
- '[[' . $newTitle->getPrefixedText() . ']]',
+ '[[' . $newTitle->getFullText() . ']]',
$text, 1 );
if ( $newText === $text ) {