mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 10:39:53 +00:00
(bug 11351) Normalise language names to lowercase for consistent class names, etc.
This commit is contained in:
parent
7c8c99db13
commit
7f976ff398
|
@ -25,11 +25,11 @@ class SyntaxHighlight_GeSHi {
|
|||
$text = trim( $text );
|
||||
// Validate language
|
||||
if( isset( $args['lang'] ) ) {
|
||||
$lang = $args['lang'];
|
||||
$lang = strtolower( $args['lang'] );
|
||||
} else {
|
||||
return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
|
||||
}
|
||||
if( !preg_match( '/^[A-Za-z_0-9-]*$/', $lang ) )
|
||||
if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) )
|
||||
return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
|
||||
$geshi = self::prepare( $text, $lang );
|
||||
if( !$geshi instanceof GeSHi )
|
||||
|
|
Loading…
Reference in a new issue