Last modified: 2010-05-15 15:59:52 UTC
The page include/ImagePage.php generates the link for "Upload a new version of this file" referring to the local server where the wiki is installed, using the function "getUploadUrl()". This cause problems when you use a reverse proxy in from of the wiki, and the RP is on another server: the link generated for "Upload a new version of this file" is for the local server and not the url masked by the RP. To fix the situation, and use a realtive url, I've applied the following patch: $ diff -urNad includes/ImagePage.php.orig includes/ImagePage.php --- includes/ImagePage.php.orig 2008-04-30 15:54:31.000000000 +0200 +++ includes/ImagePage.php 2008-04-30 15:56:10.000000000 +0200 @@ -366,7 +366,7 @@ function getUploadUrl() { global $wgServer; $uploadTitle = SpecialPage::getTitleFor( 'Upload' ); - return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) ); + return /*$wgServer .*/ $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) ); } /**
In this case, *all* your other generated full URLs would also be incorrect -- redirects, RSS feeds, action=render full URL expansion, print mode footer, etc. In situations where your web server reports the wrong hostname, protocol, or port to the PHP environment, you should ensure that $wgServer is overridden to the correct URL prefix in your LocalSettings.php.