Fix language code validation regex to allow be-x-old.
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 2 Apr 2007 17:49:12 +0000 (17:49 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 2 Apr 2007 17:49:12 +0000 (17:49 +0000)
includes/StubObject.php

index 4035f1b..894550c 100644 (file)
@@ -100,7 +100,8 @@ class StubUserLang extends StubObject {
                }        
 
                # Validate $code
-               if( empty( $code ) || !preg_match( '/^[a-z]+(-[a-z]+)?$/', $code ) ) {
+               if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) {
+                       wfDebug( "Invalid user language code\n" );
                        $code = $wgContLanguageCode;
                }