Require $wgHtml5 for $wgExperimentalHtmlIds
authorAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 1 Feb 2010 01:43:07 +0000 (01:43 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 1 Feb 2010 01:43:07 +0000 (01:43 +0000)
This way, if you want to disable HTML5 you don't have to turn off an
extra setting to maintain validity.

includes/Sanitizer.php
includes/parser/Parser.php

index 8f45cfd..9dd648c 100644 (file)
@@ -877,10 +877,10 @@ class Sanitizer {
         * @return String
         */
        static function escapeId( $id, $options = array() ) {
-               global $wgExperimentalHtmlIds;
+               global $wgHtml5, $wgExperimentalHtmlIds;
                $options = (array)$options;
 
-               if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
+               if ( $wgHtml5 && $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
                        $id = preg_replace( '/[ \t\n\r\f_\'"&]+/', '_', $id );
                        $id = trim( $id, '_' );
                        if ( $id === '' ) {
index e5e92e0..8fb333c 100644 (file)
@@ -3485,7 +3485,7 @@ class Parser
         * @private
         */
        function formatHeadings( $text, $origText, $isMain=true ) {
-               global $wgMaxTocLevel, $wgContLang, $wgExperimentalHtmlIds;
+               global $wgMaxTocLevel, $wgContLang, $wgHtml5, $wgExperimentalHtmlIds;
 
                $doNumberHeadings = $this->mOptions->getNumberHeadings();
                $showEditLink = $this->mOptions->getEditSection();
@@ -3661,7 +3661,7 @@ class Parser
                        # Save headline for section edit hint before it's escaped
                        $headlineHint = $safeHeadline;
 
-                       if ( $wgExperimentalHtmlIds ) {
+                       if ( $wgHtml5 && $wgExperimentalHtmlIds ) {
                                # For reverse compatibility, provide an id that's
                                # HTML4-compatible, like we used to.
                                #