Last modified: 2011-01-25 00:44:26 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 T23215, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21215 - NoLocalSettings.php doesn't tolerate rewrite rules
NoLocalSettings.php doesn't tolerate rewrite rules
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.16.x
All All
: Normal trivial with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-21 07:09 UTC by Max Semenik
Modified: 2011-01-25 00:44 UTC (History)
2 users (show)

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


Attachments
Patch for review (770 bytes, patch)
2009-11-15 00:02 UTC, Karun
Details
Patch that replaces path to image with relative path (576 bytes, patch)
2009-11-15 10:27 UTC, Karun
Details

Description Max Semenik 2009-10-21 07:09:01 UTC
If you visit a not installed wiki not via script path (http://example.com/w/), but via path created by rewrite rules (http://example.com/wiki/), you will see that the usual "Please set up the wiki first" message fails to display the MediaWiki logo because its relative URL is /wiki/skins/common/images/mediawiki.png. Probably, just link to the mw.org one?
Comment 1 Karun 2009-11-14 23:57:32 UTC
From looking at includes/templates/NoLocalSettings, it prefixes skins/common/images/mediawiki.png with the $path variable.
As it is relative, I propose removing $path from the image source.

Comment 2 Karun 2009-11-15 00:02:23 UTC
Created attachment 6784 [details]
Patch for review

I have completed a patch that fixes the relative path. It needs review.
Comment 3 Max Semenik 2009-11-15 10:09:52 UTC
A few comments:
-		<img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
+		<img src="skins/common/images/mediawiki.png" alt='The MediaWiki logo' />

What if MediaWiki is not set up in server root? This is a pretty common situation, by the way.

-		<?php
+		<?phpr

Please try to preview your patches before submitting, otherwise such mistakes will be inavoidable.
Comment 4 Max Semenik 2009-11-15 10:12:24 UTC
By the way, same applies to the "set up the wiki" link which leads to something like /wiki/config/index.wiki with rewrite rules.
Comment 5 Karun 2009-11-15 10:22:08 UTC
(In reply to comment #3)
> A few comments:
> -               <img src="<?php echo htmlspecialchars( $path )
> ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
> +               <img src="skins/common/images/mediawiki.png" alt='The MediaWiki
> logo' />
> 
> What if MediaWiki is not set up in server root? This is a pretty common
> situation, by the way.

skins/common/images/mediawiki.png is a relative path, so if they go to http://localhost/wiki or http://localhost/w
the web browser will get the image from the urls http://localhost/wiki/skins/common/images/mediawiki.png or http://localhost/w/skins/common/images/mediawiki.png


Comment 6 Karun 2009-11-15 10:27:41 UTC
Created attachment 6786 [details]
Patch that replaces path to image with relative path
Comment 7 Max Semenik 2009-11-15 10:32:36 UTC
(In reply to comment #5)
> skins/common/images/mediawiki.png is a relative path, so if they go to
> http://localhost/wiki or http://localhost/w
> the web browser will get the image from the urls
> http://localhost/wiki/skins/common/images/mediawiki.png or
> http://localhost/w/skins/common/images/mediawiki.png
> 

And /wiki/skins/common/images/mediawiki.png is translated by rewrite rules to something like

/w/index.php?title=skins/common/images/mediawiki.png

so your patch doesn't work.
Comment 8 Max Semenik 2009-11-15 10:39:57 UTC
Don't play around with this bug or close if without explanations.
Comment 9 Siebrand Mazeland 2010-01-09 19:00:14 UTC
Reporter, please update patch to take comment 7 into account.
Comment 10 Chad H. 2010-04-02 12:17:56 UTC
(In reply to comment #0)
> If you visit a not installed wiki not via script path (http://example.com/w/),
> but via path created by rewrite rules (http://example.com/wiki/), you will see
> that the usual "Please set up the wiki first" message fails to display the
> MediaWiki logo because its relative URL is
> /wiki/skins/common/images/mediawiki.png. 

Ugh, that's because we don't know the real script path yet...we've gotten here via rewrite rules and $wgScriptPath is useless. 

> Probably, just link to the mw.org one?

That's one solution. Only other way I can think of would be getting the dirname and trying to guess. But that's very likely to fail.
Comment 11 Chad H. 2010-08-08 16:07:33 UTC
Fixed in r70711 :)

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


Navigation
Links