From 5f06aaca1c69a82fd3ddf784b3194f7d8ab722b3 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Mon, 4 Sep 2017 19:29:50 +0000 Subject: [PATCH] I18N: Allow numbers in locales during installation. The current regex was a bit to strict for locales like `pt_PT_ao90` which were already supported by `wp_get_installed_translations()`. Fixes #41794. git-svn-id: https://develop.svn.wordpress.org/trunk@41335 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/install.php | 2 +- src/wp-admin/setup-config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index a24baff3b6..0021421007 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -281,7 +281,7 @@ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { */ $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { - $language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] ); + $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; } diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index db10e25be2..c1fe1eb808 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -105,7 +105,7 @@ function setup_config_display_header( $body_classes = array() ) { $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { - $language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] ); + $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; }