r25873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25872‎ | r25873 | r25874 >
Date:16:09, 15 September 2007
Author:robchurch
Status:old
Tags:
Comment:
(bug 11351) Normalise language names to lowercase for consistent class names, etc.
Modified paths:
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -25,11 +25,11 @@
2626 $text = trim( $text );
2727 // Validate language
2828 if( isset( $args['lang'] ) ) {
29 - $lang = $args['lang'];
 29+ $lang = strtolower( $args['lang'] );
3030 } else {
3131 return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
3232 }
33 - if( !preg_match( '/^[A-Za-z_0-9-]*$/', $lang ) )
 33+ if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) )
3434 return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
3535 $geshi = self::prepare( $text, $lang );
3636 if( !$geshi instanceof GeSHi )

Status & tagging log