r20947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20946‎ | r20947 | r20948 >
Date:17:49, 2 April 2007
Author:tstarling
Status:old
Tags:
Comment:
Fix language code validation regex to allow be-x-old.
Modified paths:
  • /trunk/phase3/includes/StubObject.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/StubObject.php
@@ -100,7 +100,8 @@
101101 }
102102
103103 # Validate $code
104 - if( empty( $code ) || !preg_match( '/^[a-z]+(-[a-z]+)?$/', $code ) ) {
 104+ if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) {
 105+ wfDebug( "Invalid user language code\n" );
105106 $code = $wgContLanguageCode;
106107 }
107108