r77065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77064‎ | r77065 | r77066 >
Date:20:24, 20 November 2010
Author:krinkle
Status:ok
Tags:
Comment:
Making path to bullet.gif in config.css relative to it self instead of absolute.
* Installer has a 'Status of 404 (Not Found)' (/w/skins/skins/vector/images/bullet.gif). Source of this problem is "str_replace( 'images/', '../skins/vector/images/', );" on line 99 of WebInstallerOutput.php::GetCSS() which transforms this line:
list-style-image: url(../skins/common/images/bullet.gif);
into this:
list-style-image: url(../skins/common/../skins/vector/images/bullet.gif);
all other stylesheets do it relative also, therefor changing this accordingly to:
list-style-image: url(images/bullet.gif);
But since the installer does not load them directly but includes them from a different path, the str_replace() has been changed from a single replace for both files to two replaces, since they are not both in /vector/ images, config.css is in /common/ and it's images are in /common/images, not /vector/images. Fixed now.
Modified paths:
  • /trunk/phase3/includes/installer/WebInstallerOutput.php (modified) (history)
  • /trunk/phase3/skins/common/config.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/config.css
@@ -94,7 +94,7 @@
9595 .config-message {
9696 display: list-item;
9797 line-height: 1.5em;
98 - list-style-image: url(../skins/common/images/bullet.gif);
 98+ list-style-image: url(images/bullet.gif);
9999 list-style-type: square;
100100 }
101101
Index: trunk/phase3/includes/installer/WebInstallerOutput.php
@@ -89,14 +89,16 @@
9090 $vectorCssFile = "$skinDir/vector/screen.css";
9191 $configCssFile = "$skinDir/common/config.css";
9292 wfSuppressWarnings();
93 - $css = file_get_contents( $vectorCssFile ) . "\n" . file_get_contents( $configCssFile );
 93+ $vectorCss = file_get_contents( $vectorCssFile );
 94+ $configCss = file_get_contents( $configCssFile );
9495 wfRestoreWarnings();
 96+ $css = str_replace( 'images/', '../skins/vector/images/', $vectorCss ) . "\n" . str_replace( 'images/', '../skins/common/images/', $configCss );
9597 if( !$css ) {
9698 return "/** Your webserver cannot read $vectorCssFile or $configCssFile, please check file permissions */";
9799 } elseif( $dir == 'rtl' ) {
98100 $css = CSSJanus::transform( $css, true );
99101 }
100 - return str_replace( 'images/', '../skins/vector/images/', $css );
 102+ return $css;
101103 }
102104
103105 /**

Status & tagging log