From 6ff6ded2fc0fa8ddb653a53415b9a436637e0aa2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 5 Sep 2014 20:17:40 +0200 Subject: [PATCH] Html: Don't accept paths relative to skins/common/images/ in infoBox() There are no files worth referencing there anymore. No usages found in extensions, only one usage in core already didn't depend on that behavior. Change-Id: If1fd68a3a7355c8195fd2aad86e7584a5772bd4c --- RELEASE-NOTES-1.24 | 5 +++-- includes/Html.php | 11 ++--------- includes/installer/WebInstaller.php | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 3b40a9e062..74521c3f17 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -449,10 +449,11 @@ changes to languages because of Bugzilla reports. called unconditionally. * TablePager::getBody() is now 'final' and can't be overridden in subclasses. * TablePager::getBody() is deprecated, use getBodyOutput() or getFullOutput(). -* log_page for move log entries store the original page ID, rather than that +* log_page for move log entries store the original page ID, rather than that of the new redirect page. This is not retroactive. -* LCStoreAccel was removed. $wgLocalisationCacheConf can no longer be set to +* LCStoreAccel was removed. $wgLocalisationCacheConf can no longer be set to use this store class. +* Html::infoBox() no longer accepts paths relative to skins/common/images/. ==== Renamed classes ==== * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression diff --git a/includes/Html.php b/includes/Html.php index 48dbdba691..1e16e39430 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -937,20 +937,13 @@ class Html { * Get HTML for an info box with an icon. * * @param string $text Wikitext, get this with wfMessage()->plain() - * @param string $icon Icon name, file in skins/common/images + * @param string $icon Path to icon file (used as 'src' attribute) * @param string $alt Alternate text for the icon * @param string $class Additional class name to add to the wrapper div - * @param bool $useStylePath * * @return string */ - static function infoBox( $text, $icon, $alt, $class = false, $useStylePath = true ) { - global $wgStylePath; - - if ( $useStylePath ) { - $icon = $wgStylePath . '/common/images/' . $icon; - } - + static function infoBox( $text, $icon, $alt, $class = false ) { $s = Html::openElement( 'div', array( 'class' => "mw-infobox $class" ) ); $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ) . diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 3a3e809cc6..f3dba3a72d 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -679,7 +679,7 @@ class WebInstaller extends Installer { 'images/' . $icon; $alt = wfMessage( 'config-information' )->text(); - return Html::infoBox( $text, $icon, $alt, $class, false ); + return Html::infoBox( $text, $icon, $alt, $class ); } /** -- 2.20.1