Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223346

Change subject: Empty attribute syntax
......................................................................

Empty attribute syntax

 * The value is implicitly the empty string.
   http://www.w3.org/TR/html5/syntax.html#syntax-attribute-name

Bug: T54330
Change-Id: I8591ef209fb7337fb39ad6e45135942d074373bc
---
M includes/Sanitizer.php
M tests/parser/parserTests.txt
2 files changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/223346/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index 2340cd9..4551466 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1276,9 +1276,7 @@
                        # Double-quoted
                        return $set[3];
                } elseif ( !isset( $set[2] ) ) {
-                       # In XHTML, attributes must have a value.
-                       # For 'reduced' form, return explicitly the attribute 
name here.
-                       return $set[1];
+                       return "";
                } else {
                        throw new MWException( "Tag conditions not met. This 
should never happen and is a bug." );
                }
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 18d9aa8..086baa7 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -7980,8 +7980,8 @@
 <br title=bar/>
 <br title=bar/ >
 !! html/php
-<p><br title="title" />
-<br title="title" />
+<p><br title="" />
+<br title="" />
 <br />
 <br title="bar" />
 <br title="bar" />
@@ -14633,7 +14633,7 @@
 !! wikitext
 <font color>foo</font>
 !! html
-<p><font color="color">foo</font>
+<p><font color="">foo</font>
 </p>
 !! end
 
@@ -15165,7 +15165,7 @@
   'width' => '200',
   'height' => '100',
   'depth' => '50',
-  'square' => 'square',
+  'square' => '',
 )
 </pre>
 
@@ -15213,7 +15213,7 @@
   'width' => '200',
   'height' => '100',
   'depth' => '50',
-  'square' => 'square',
+  'square' => '',
 )
 </pre>
 <p>other stuff
@@ -15360,7 +15360,7 @@
        <link rel="stylesheet" itemprop="hello" href="{{SERVER}}">
 </div>
 !! html
-<div itemscope="itemscope">
+<div itemscope="">
 <p>    <meta itemprop="hello" content="world" />
        &lt;meta http-equiv="refresh" content="5"&gt;
        <meta itemprop="hello" content="5" />
@@ -19279,7 +19279,7 @@
 showindicators
 !! wikitext
 <indicator name="empty" />
-<indicator name></indicator>
+<indicator name="name"></indicator>
 !! html
 empty=
 name=

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8591ef209fb7337fb39ad6e45135942d074373bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

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

Reply via email to