r61772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61771‎ | r61772 | r61773 >
Date:01:43, 1 February 2010
Author:simetrical
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -3485,7 +3485,7 @@
34863486 * @private
34873487 */
34883488 function formatHeadings( $text, $origText, $isMain=true ) {
3489 - global $wgMaxTocLevel, $wgContLang, $wgExperimentalHtmlIds;
 3489+ global $wgMaxTocLevel, $wgContLang, $wgHtml5, $wgExperimentalHtmlIds;
34903490
34913491 $doNumberHeadings = $this->mOptions->getNumberHeadings();
34923492 $showEditLink = $this->mOptions->getEditSection();
@@ -3661,7 +3661,7 @@
36623662 # Save headline for section edit hint before it's escaped
36633663 $headlineHint = $safeHeadline;
36643664
3665 - if ( $wgExperimentalHtmlIds ) {
 3665+ if ( $wgHtml5 && $wgExperimentalHtmlIds ) {
36663666 # For reverse compatibility, provide an id that's
36673667 # HTML4-compatible, like we used to.
36683668 #
Index: trunk/phase3/includes/Sanitizer.php
@@ -877,10 +877,10 @@
878878 * @return String
879879 */
880880 static function escapeId( $id, $options = array() ) {
881 - global $wgExperimentalHtmlIds;
 881+ global $wgHtml5, $wgExperimentalHtmlIds;
882882 $options = (array)$options;
883883
884 - if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
 884+ if ( $wgHtml5 && $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
885885 $id = preg_replace( '/[ \t\n\r\f_\'"&]+/', '_', $id );
886886 $id = trim( $id, '_' );
887887 if ( $id === '' ) {

Status & tagging log