Allow all itemtypes for microdata
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 11 Mar 2011 02:10:00 +0000 (02:10 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 11 Mar 2011 02:10:00 +0000 (02:10 +0000)
It's really not all that useful otherwise.

RELEASE-NOTES
includes/Sanitizer.php

index f2cbf0a..a592d65 100644 (file)
@@ -96,6 +96,8 @@ PHP if you have not done so prior to upgrading MediaWiki.
   differently (italicized by default) on Special:SpecialPages
 * Added $wgAggregateStatsID, which allows UDP stats to be aggregated over
   several wikis.
+* When $wgAllowMicrodataAttributes is true, all itemtypes are allowed, not just
+  the three that were defined in the original specification.
 
 === Bug fixes in 1.18 ===
 * (bug 23119) WikiError class and subclasses are now marked as deprecated
index 0fc5a1c..e26c86d 100644 (file)
@@ -686,19 +686,6 @@ class Sanitizer {
                }
 
                if ( $wgAllowMicrodataAttributes ) {
-                       # There are some complicated validity constraints we need to
-                       # enforce here.  First of all, we don't want to allow non-standard
-                       # itemtypes.
-                       $allowedTypes = array(
-                               'http://microformats.org/profile/hcard',
-                               'http://microformats.org/profile/hcalendar#vevent',
-                               'http://n.whatwg.org/work',
-                       );
-                       if ( isset( $out['itemtype'] ) && !in_array( $out['itemtype'],
-                       $allowedTypes ) ) {
-                               # Kill everything
-                               unset( $out['itemscope'] );
-                       }
                        # itemtype, itemid, itemref don't make sense without itemscope
                        if ( !array_key_exists( 'itemscope', $out ) ) {
                                unset( $out['itemtype'] );