jenkins-bot has submitted this change and it was merged.

Change subject: Use Sanitizer::escapeClass to handle e.g. spaces in group ids
......................................................................


Use Sanitizer::escapeClass to handle e.g. spaces in group ids

Change-Id: I8e132ad5356458774f789adf030a920c6b974c29
---
M ResourceLoaderProjectIconsModule.php
M specials/SpecialTwnMainPage.php
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Santhosh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ResourceLoaderProjectIconsModule.php 
b/ResourceLoaderProjectIconsModule.php
index 68ac51d..a52c16f 100644
--- a/ResourceLoaderProjectIconsModule.php
+++ b/ResourceLoaderProjectIconsModule.php
@@ -23,7 +23,8 @@
                $icons = array();
                foreach ( $projects as $group ) {
                        wfSuppressWarnings();
-                       $icons[$group->getId()] = TranslateUtils::getIcon( 
$group, 100 );
+                       $id = Sanitizer::escapeClass( $group->getId() );
+                       $icons[$id] = TranslateUtils::getIcon( $group, 100 );
                        wfRestoreWarnings();
                }
 
diff --git a/specials/SpecialTwnMainPage.php b/specials/SpecialTwnMainPage.php
index ae69169..64781b1 100644
--- a/specials/SpecialTwnMainPage.php
+++ b/specials/SpecialTwnMainPage.php
@@ -238,7 +238,8 @@
                        $linked = 'linked';
                }
 
-               $image = Html::element( 'div', array( 'class' => 
"project-icon-$id" ) );
+               $class = 'project-icon-' . Sanitizer::escapeClass( $id );
+               $image = Html::element( 'div', array( 'class' => $class ) );
                $label = htmlspecialchars( $group->getLabel( 
$this->getContext() ) );
 
                $title = SpecialPage::getTitleFor( 'Translate' );

-- 
To view, visit https://gerrit.wikimedia.org/r/90746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e132ad5356458774f789adf030a920c6b974c29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwnMainPage
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: SuchetaG <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to