From: Arlo Breault Date: Sat, 1 Apr 2017 13:59:21 +0000 (-0400) Subject: Valid tags on a gallery should correspond to unordered list X-Git-Tag: 1.31.0-rc.0~3622^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=aea349488c0a8bca055ae14ba698297011478dac 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 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 47d9a62327..be4557d6f9 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4975,7 +4975,7 @@ class Parser { $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 2def8751ee..3a31351d95 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -19069,6 +19069,23 @@ title=[[Parser test]] !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. +!! test +Gallery with valid attributes +!! wikitext + +File:File:Foobar.jpg + +!! html/php + + +!! end + ## Parsoid thinks the "centre" here is a property, not a caption. !! test Gallery