Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -626,6 +626,16 @@ |
627 | 627 | $wgEnforceHtmlIds ? 'noninitial' : 'xml' ); |
628 | 628 | } |
629 | 629 | |
| 630 | + //RDFa properties allow URIs. check them |
| 631 | + if ( $attribute === 'rel' || $attribute === 'rev' || |
| 632 | + $attribute === 'about' || $attribute === 'property' || $attribute === 'resource' || |
| 633 | + $attribute === 'datatype' || $attribute === 'typeof' ) { |
| 634 | + //Paranoia. Allow "simple" values but suppress javascript |
| 635 | + if ( preg_match( '/(^|\s)javascript\s*:/i', $value ) ) { |
| 636 | + continue; |
| 637 | + } |
| 638 | + } |
| 639 | + |
630 | 640 | // If this attribute was previously set, override it. |
631 | 641 | // Output should only have one attribute of each name. |
632 | 642 | $out[$attribute] = $value; |
— | — | @@ -1154,7 +1164,11 @@ |
1155 | 1165 | * @return Array |
1156 | 1166 | */ |
1157 | 1167 | static function setupAttributeWhitelist() { |
1158 | | - $common = array( 'id', 'class', 'lang', 'dir', 'title', 'style' ); |
| 1168 | + $common = array( 'id', 'class', 'lang', 'dir', 'title', 'style', |
| 1169 | + #RDFa attributes as specified in section 9 of http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014 |
| 1170 | + 'about', 'property', 'resource', 'datatype', 'typeof', |
| 1171 | + ); |
| 1172 | + |
1159 | 1173 | $block = array_merge( $common, array( 'align' ) ); |
1160 | 1174 | $tablealign = array( 'align', 'char', 'charoff', 'valign' ); |
1161 | 1175 | $tablecell = array( 'abbr', |