r50751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50750‎ | r50751 | r50752 >
Date:20:28, 18 May 2009
Author:brion
Status:ok
Tags:
Comment:
Follow-up to r50693 "Add optional $wgSyntaxHighlightDefaultLang parameter; allows people to set a default language that shows up if the lang parameter is missing."
Fix whitespace (tab/space issues) and drop duplicated strtolower() call to common code path
Modified paths:
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -28,15 +28,16 @@
2929 $text = preg_replace( '/^\n+/', '', $text );
3030 // Validate language
3131 if( isset( $args['lang'] ) ) {
32 - $lang = strtolower( $args['lang'] );
 32+ $lang = $args['lang'];
3333 } else {
3434 // language is not specified. Check if default exists, if yes, use it.
35 - if ( !is_null($wgSyntaxHighlightDefaultLang) ) {
36 - $lang = strtolower($wgSyntaxHighlightDefaultLang);
37 - } else {
38 - return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
39 - }
 35+ if ( !is_null( $wgSyntaxHighlightDefaultLang ) ) {
 36+ $lang = $wgSyntaxHighlightDefaultLang;
 37+ } else {
 38+ return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
 39+ }
4040 }
 41+ $lang = strtolower( $lang );
4142 if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) )
4243 return self::formatError( htmlspecialchars( wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
4344 $geshi = self::prepare( $text, $lang );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50693Add optional $wgSyntaxHighlightDefaultLang parameter; allows people to set a ...soxred9315:21, 17 May 2009

Status & tagging log