Revision: 50751
Author:   brion
Date:     2009-05-18 20:28:50 +0000 (Mon, 18 May 2009)

Log Message:
-----------
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: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
===================================================================
--- trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php      
2009-05-18 20:27:13 UTC (rev 50750)
+++ trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php      
2009-05-18 20:28:50 UTC (rev 50751)
@@ -28,15 +28,16 @@
                $text = preg_replace( '/^\n+/', '', $text );
                // Validate language
                if( isset( $args['lang'] ) ) {
-                       $lang = strtolower( $args['lang'] );
+                       $lang = $args['lang'];
                } else {
                        // language is not specified. Check if default exists, 
if yes, use it.
-            if ( !is_null($wgSyntaxHighlightDefaultLang) ) {
-                $lang = strtolower($wgSyntaxHighlightDefaultLang);
-            } else {
-                return self::formatError( htmlspecialchars( wfMsgForContent( 
'syntaxhighlight-err-language' ) ) );
-            }
+                       if ( !is_null( $wgSyntaxHighlightDefaultLang ) ) {
+                               $lang = $wgSyntaxHighlightDefaultLang;
+                       } else {
+                               return self::formatError( htmlspecialchars( 
wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
+                       }
                }
+               $lang = strtolower( $lang );
                if( !preg_match( '/^[a-z_0-9-]*$/', $lang ) )
                        return self::formatError( htmlspecialchars( 
wfMsgForContent( 'syntaxhighlight-err-language' ) ) );
                $geshi = self::prepare( $text, $lang );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to