https://bugzilla.wikimedia.org/show_bug.cgi?id=57762

       Web browser: ---
            Bug ID: 57762
           Summary: Older redirect format are not recognized anymore
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Redirects
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

I just found an old redirect at
https://zh.wikipedia.org/w/index.php?title=2007%E5%8E%A6%E9%97%A8PX%E9%A1%B9%E7%9B%AE%E7%BC%93%E5%BB%BA&action=history
which worked in the day of creation, but doesn't work anymore.

Redirect parsing code at that time (in commit
5cdc003c00c5b7dbc8395bc10ea067b1bbc19a44, Thu Jun 14 17:36:12 2007 +0000):

/**
 * Create a new Title for a redirect
 * @param string $text the redirect title text
 * @return Title the new object, or NULL if the text is not a
 *      valid redirect
 */
public static function newFromRedirect( $text ) {
        $mwRedir = MagicWord::get( 'redirect' );
        $rt = NULL;
        if ( $mwRedir->matchStart( $text ) ) {
                $m = array();
                if ( preg_match( '/\[{2}(.*?)(?:\||\]{2})/', $text, $m ) ) {
                        # categories are escaped using : for example one can
enter:
                        # #REDIRECT [[:Category:Music]]. Need to remove it.
                        if ( substr($m[1],0,1) == ':') {
                                # We don't want to keep the ':'
                                $m[1] = substr( $m[1], 1 );
                        }

                        $rt = Title::newFromText( $m[1] );
                        # Disallow redirects to Special:Userlogout
                        if ( !is_null($rt) && $rt->isSpecial( 'Userlogout' ) )
{
                                $rt = NULL;
                        }
                }
        }
        return $rt;
}

I'm not sure when it was made more strict, but obviously it broke some old
content and people didn't try to clean them up.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to