From dc7a748b8a4550d93dc60f483ae97be6a05c37a6 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 2 Apr 2007 17:49:12 +0000 Subject: [PATCH] Fix language code validation regex to allow be-x-old. --- includes/StubObject.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.20.1