Replace remaining Array occurences with array
[lhc/web/wiklou.git] / tests / phpunit / includes / SanitizerTest.php
index c929989..ac9971e 100644 (file)
@@ -136,10 +136,26 @@ class SanitizerTest extends MediaWikiTestCase {
                        array( 'nowrap=""', 'td', ' style="white-space: nowrap;"', 'nowrap="" is considered true, not false' ),
                        array( 'NOWRAP="true"', 'td', ' style="white-space: nowrap;"', 'nowrap attribute works when uppercase.' ),
                        array( 'NoWrAp="true"', 'td', ' style="white-space: nowrap;"', 'nowrap attribute works when mixed-case.' ),
-                       array( 'align="right"', 'td', ' style="text-align: right;"', 'align on table cells gets converted to text-align' ),
-                       array( 'align="center"', 'td', ' style="text-align: center;"', 'align on table cells gets converted to text-align' ),
-                       array( 'align="left"', 'div', ' style="float: left;"', 'align=(left|right) on non-cells gets converted to float' ),
-                       array( 'align="center"', 'div', ' style="margin-left: auto; margin-right: auto;"', 'align="center" on non-cells' ),
+                       array( 'align="right"', 'td', ' style="text-align: right;"'   , 'align on table cells gets converted to text-align' ),
+                       array( 'align="center"', 'td', ' style="text-align: center;"' , 'align on table cells gets converted to text-align' ),
+                       array( 'align="left"'  , 'div', ' style="text-align: left;"'  , 'align=(left|right) on div elements gets converted to text-align' ),
+                       array( 'align="center"', 'div', ' style="text-align: center;"', 'align="center" on div elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'p',   ' style="text-align: left;"'  , 'align on p elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'h1',  ' style="text-align: left;"'  , 'align on h1 elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'h1',  ' style="text-align: left;"'  , 'align on h1 elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'caption',' style="text-align: left;"','align on caption elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'tfoot',' style="text-align: left;"' , 'align on tfoot elements gets converted to text-align' ),
+                       array( 'align="left"'  , 'tbody',' style="text-align: left;"' , 'align on tbody elements gets converted to text-align' ),
+
+                       # <tr>
+                       array( 'align="right"' , 'tr', ' style="text-align: right;"' , 'align on table row get converted to text-align' ),
+                       array( 'align="center"', 'tr', ' style="text-align: center;"', 'align on table row get converted to text-align' ),
+                       array( 'align="left"'  , 'tr', ' style="text-align: left;"'  , 'align on table row get converted to text-align' ),
+
+                       #table
+                       array( 'align="left"'  , 'table', ' style="float: left;"'    , 'align on table converted to float' ),
+                       array( 'align="center"', 'table', ' style="margin-left: auto; margin-right: auto;"', 'align center on table converted to margins' ),
+                       array( 'align="right"' , 'table', ' style="float: right;"'   , 'align on table converted to float' ),
                );
        }
 
@@ -166,6 +182,12 @@ class SanitizerTest extends MediaWikiTestCase {
                                'Remove anything after a comment-start token' ),
                        array( '', "\\2f\\2a unifinished comment'",
                                'Remove anything after a backslash-escaped comment-start token' ),
+                       array( '/* insecure input */', 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\');'),
+                       array( '/* insecure input */', '-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\')";'),
+                       array( '/* insecure input */', 'width: expression(1+1);'),
+                       array( '/* insecure input */', 'background-image: image(asdf.png);'),
+                       array( '/* insecure input */', 'background-image: -webkit-image(asdf.png);'),
+                       array( '/* insecure input */', 'background-image: -moz-image(asdf.png);'),
                );
        }
 }