Introduce get_available_languages(). Validate WPLANG. fixes #11774

git-svn-id: http://svn.automattic.com/wordpress/trunk@12946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2010-02-04 18:46:25 +00:00
parent b595595a43
commit cf7da6eab8
3 changed files with 30 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ switch ( $_GET['action'] ) {
if ( empty( $_POST ) )
wp_die( __("You probably need to go back to the <a href='ms-options.php'>options page</a>") );
if ( isset($_POST['WPLANG']) )
if ( isset($_POST['WPLANG']) && ( '' === $_POST['WPLANG'] || in_array($_POST['WPLANG'], get_available_languages()) ) )
update_site_option( "WPLANG", $_POST['WPLANG'] );
if ( is_email( $_POST['admin_email'] ) )