Author: rotemliss
Description:
If I set up two wikis in one server and link them using interwiki links
(iw_local=1), the redirect http://domain.com/wiki1/index.php/wiki2:Main_Page
does not work (I get "Bad title" error) and vice versa. However, if I set up two
wikis in two servers and link *them* using interwiki links (iw_local=1), the
redirect http://wiki1.domain.com/index.php/wiki2:Main_Page *does* work. The
problem is caused by line 141 of Wiki.php, when the following "if" statement is
used to choose whether to redirect, or to show a "Bad title" error message:
/* Check for a redirect loop */
if ( !preg_match( '/^' . preg_quote( $this->getVal('Server'), '/' ) . '/', $url
) && $title->isLocal() )
$url is the redirected URL, and the if statement checks if we redirect within
the same server. It's good for Wikimedia sites, but not good for sites which use
two wikis in one server. Why is this check necessary at all? Which URL can cause
a redirect loop?
Version: unspecified
Severity: minor