Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -650,11 +650,12 @@ |
651 | 651 | $wgEnforceHtmlIds ? 'noninitial' : 'xml' ); |
652 | 652 | } |
653 | 653 | |
654 | | - //RDFa and microdata properties allow URIs. check them |
| 654 | + //RDFa and microdata properties allow URLs, URIs and/or CURIs. check them for sanity |
655 | 655 | if ( $attribute === 'rel' || $attribute === 'rev' || |
656 | | - $attribute === 'about' || $attribute === 'property' || $attribute === 'resource' || |
657 | | - $attribute === 'datatype' || $attribute === 'typeof' || |
658 | | - $attribute === 'item' || $attribute === 'itemprop' || $attribute === 'subject' ) { |
| 656 | + $attribute === 'about' || $attribute === 'property' || $attribute === 'resource' || #RDFa |
| 657 | + $attribute === 'datatype' || $attribute === 'typeof' || #RDFa |
| 658 | + $attribute === 'itemid' || $attribute === 'itemprop' || $attribute === 'itemref' || #HTML5 microdata |
| 659 | + $attribute === 'itemscope' || $attribute === 'itemtype' ) { #HTML5 microdata |
659 | 660 | |
660 | 661 | //Paranoia. Allow "simple" values but suppress javascript |
661 | 662 | if ( preg_match( MW_EVIL_URI_PATTERN, $value ) ) { |
— | — | @@ -1199,7 +1200,7 @@ |
1200 | 1201 | * @return Array |
1201 | 1202 | */ |
1202 | 1203 | static function setupAttributeWhitelist() { |
1203 | | - global $wgAllowRdfaAttributes, $wgHtml5, $wgAllowItemAttributes; |
| 1204 | + global $wgAllowRdfaAttributes, $wgHtml5, $wgAllowMicrodataAttributes; |
1204 | 1205 | |
1205 | 1206 | $common = array( 'id', 'class', 'lang', 'dir', 'title', 'style', 'xml:lang' ); |
1206 | 1207 | |
— | — | @@ -1210,10 +1211,10 @@ |
1211 | 1212 | ) ); |
1212 | 1213 | } |
1213 | 1214 | |
1214 | | - if ( $wgHtml5 && $wgAllowItemAttributes ) { |
1215 | | - # add HTML5 microdata tages as pecified by http://www.w3.org/TR/html5/microdata.html |
| 1215 | + if ( $wgHtml5 && $wgAllowMicrodataAttributes ) { |
| 1216 | + # add HTML5 microdata tages as pecified by http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#the-microdata-model |
1216 | 1217 | $common = array_merge( $common, array( |
1217 | | - 'item', 'itemprop', 'subject' |
| 1218 | + 'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype' |
1218 | 1219 | ) ); |
1219 | 1220 | } |
1220 | 1221 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -921,14 +921,15 @@ |
922 | 922 | $wgHtml5Version = null; |
923 | 923 | |
924 | 924 | /** |
925 | | - * Enabled RDFa attributes for use in wikitext. |
| 925 | + * Enabled RDFa attributes for use in wikitext. |
| 926 | + * NOTE: Interaction with HTML5 is somewhat underspecified. |
926 | 927 | */ |
927 | 928 | $wgAllowRdfaAttributes = true; |
928 | 929 | |
929 | 930 | /** |
930 | | - * Enabled HTML 5 data attributes for use in wikitext, if $wgHtml5 is also true. |
| 931 | + * Enabled HTML 5 microdata attributes for use in wikitext, if $wgHtml5 is also true. |
931 | 932 | */ |
932 | | -$wgAllowItemAttributes = true; |
| 933 | +$wgAllowMicrodataAttributes = true; |
933 | 934 | |
934 | 935 | /** |
935 | 936 | * Should we try to make our HTML output well-formed XML? If set to false, |