Last modified: 2010-05-15 15:59:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15898, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13898 - ImagePage refers to local server for Upload new version
ImagePage refers to local server for Upload new version
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.11.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-30 13:59 UTC by Sandro Tosi
Modified: 2010-05-15 15:59 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sandro Tosi 2008-04-30 13:59:30 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() ) );
        }

        /**
Comment 1 Brion Vibber 2008-04-30 18:56:44 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links