From 133b549c8d3498aff741cb3f5ec95001c918eaca Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 5 Mar 2008 01:07:47 +0000 Subject: [PATCH] Fix bug 13253: foo causes exception --- includes/Preprocessor_DOM.php | 5 +++-- includes/Preprocessor_Hash.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/Preprocessor_DOM.php b/includes/Preprocessor_DOM.php index 0e2e9a1615..f476b958f7 100644 --- a/includes/Preprocessor_DOM.php +++ b/includes/Preprocessor_DOM.php @@ -267,6 +267,7 @@ class Preprocessor_DOM implements Preprocessor { continue; } $name = $matches[1]; + $lowerName = strtolower( $name ); $attrStart = $i + strlen( $name ) + 1; // Find end of tag @@ -281,7 +282,7 @@ class Preprocessor_DOM implements Preprocessor { } // Handle ignored tags - if ( in_array( $name, $ignoredTags ) ) { + if ( in_array( $lowerName, $ignoredTags ) ) { $accum .= '' . htmlspecialchars( substr( $text, $i, $tagEndPos - $i + 1 ) ) . ''; $i = $tagEndPos + 1; continue; @@ -308,7 +309,7 @@ class Preprocessor_DOM implements Preprocessor { } } // and just become tags - if ( in_array( $name, $ignoredElements ) ) { + if ( in_array( $lowerName, $ignoredElements ) ) { $accum .= '' . htmlspecialchars( substr( $text, $tagStartPos, $i - $tagStartPos ) ) . ''; continue; diff --git a/includes/Preprocessor_Hash.php b/includes/Preprocessor_Hash.php index 2034278d4b..64ed8eb3c0 100644 --- a/includes/Preprocessor_Hash.php +++ b/includes/Preprocessor_Hash.php @@ -254,6 +254,7 @@ class Preprocessor_Hash implements Preprocessor { continue; } $name = $matches[1]; + $lowerName = strtolower( $name ); $attrStart = $i + strlen( $name ) + 1; // Find end of tag @@ -268,7 +269,7 @@ class Preprocessor_Hash implements Preprocessor { } // Handle ignored tags - if ( in_array( $name, $ignoredTags ) ) { + if ( in_array( $lowerName, $ignoredTags ) ) { $accum->addNodeWithText( 'ignore', substr( $text, $i, $tagEndPos - $i + 1 ) ); $i = $tagEndPos + 1; continue; @@ -296,7 +297,7 @@ class Preprocessor_Hash implements Preprocessor { } } // and just become tags - if ( in_array( $name, $ignoredElements ) ) { + if ( in_array( $lowerName, $ignoredElements ) ) { $accum->addNodeWithText( 'ignore', substr( $text, $tagStartPos, $i - $tagStartPos ) ); continue; } -- 2.20.1