jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/345973 )

Change subject: Valid tags on a gallery should correspond to unordered list
......................................................................


Valid tags on a gallery should correspond to unordered list

 * This was introduced in 4d3446a8e3e when galleries were tables.
   However, in 05579cf0e60, it switched to ul's, but missed updating the
   sanitization.

 * As an example, the test shows that summary is currently wrongly
   permitted.

Change-Id: I8c52477dc65499d0c8a1ee5cc661a5f9ae78cc07
---
M includes/parser/Parser.php
M tests/parser/parserTests.txt
2 files changed, 18 insertions(+), 1 deletion(-)

Approvals:
  Subramanya Sastry: Looks good to me, but someone else must approve
  Brion VIBBER: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 47d9a62..be4557d 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -4975,7 +4975,7 @@
                $ig->setShowFilename( false );
                $ig->setParser( $this );
                $ig->setHideBadImages();
-               $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 
'table' ) );
+               $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 
'ul' ) );
 
                if ( isset( $params['showfilename'] ) ) {
                        $ig->setShowFilename( true );
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 2def875..3a31351 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -19069,6 +19069,23 @@
 !! end
 ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it 
generates a MySQL error when included.
 
+!! test
+Gallery with valid attributes
+!! wikitext
+<gallery type="123" summary="345">
+File:File:Foobar.jpg
+</gallery>
+!! html/php
+<ul class="gallery mw-gallery-traditional" type="123">
+               <li class="gallerybox" style="width: 155px"><div style="width: 
155px">
+                       <div class="thumb" style="height: 
150px;">File:Foobar.jpg</div>
+                       <div class="gallerytext">
+                       </div>
+               </div></li>
+</ul>
+
+!! end
+
 ## Parsoid thinks the "centre" here is a property, not a caption.
 !! test
 Gallery

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c52477dc65499d0c8a1ee5cc661a5f9ae78cc07
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.org>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to