From: Tim Starling Date: Mon, 2 Apr 2007 17:49:12 +0000 (+0000) Subject: Fix language code validation regex to allow be-x-old. X-Git-Tag: 1.31.0-rc.0~53494 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=dc7a748b8a4550d93dc60f483ae97be6a05c37a6;p=lhc%2Fweb%2Fwiklou.git Fix language code validation regex to allow be-x-old. --- diff --git a/includes/StubObject.php b/includes/StubObject.php index 4035f1bd34..894550cda1 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -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; }