Last modified: 2011-01-25 00:44:26 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?
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.
Created attachment 6784 [details] Patch for review I have completed a patch that fixes the relative path. It needs review.
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.
By the way, same applies to the "set up the wiki" link which leads to something like /wiki/config/index.wiki with rewrite rules.
(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
Created attachment 6786 [details] Patch that replaces path to image with relative path
(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.
Don't play around with this bug or close if without explanations.
Reporter, please update patch to take comment 7 into account.
(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.
Fixed in r70711 :)