From a889c89d1ba38f2b9f21ee696628dbce2442d788 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 1 Feb 2010 01:43:07 +0000 Subject: [PATCH] Require $wgHtml5 for $wgExperimentalHtmlIds This way, if you want to disable HTML5 you don't have to turn off an extra setting to maintain validity. --- includes/Sanitizer.php | 4 ++-- includes/parser/Parser.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 8f45cfd119..9dd648cb08 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -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 === '' ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e5e92e039c..8fb333c86a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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. # -- 2.20.1