diff -r c7c34916027a -r 177826044cd9 wp/wp-admin/includes/translation-install.php --- a/wp/wp-admin/includes/translation-install.php Mon Oct 14 18:06:33 2019 +0200 +++ b/wp/wp-admin/includes/translation-install.php Mon Oct 14 18:28:13 2019 +0200 @@ -20,7 +20,7 @@ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version if ( ! in_array( $type, array( 'plugins', 'themes', 'core' ) ) ) { - return new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) ); + return new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) ); } /** @@ -42,7 +42,7 @@ $options = array( 'timeout' => 3, - 'body' => array( + 'body' => array( 'wp_version' => $wp_version, 'locale' => get_locale(), 'version' => $args['version'], // Version of plugin, theme or core @@ -69,7 +69,8 @@ } if ( is_wp_error( $request ) ) { - $res = new WP_Error( 'translations_api_failed', + $res = new WP_Error( + 'translations_api_failed', sprintf( /* translators: %s: support forums URL */ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ), @@ -80,7 +81,8 @@ } else { $res = json_decode( wp_remote_retrieve_body( $request ), true ); if ( ! is_object( $res ) && ! is_array( $res ) ) { - $res = new WP_Error( 'translations_api_failed', + $res = new WP_Error( + 'translations_api_failed', sprintf( /* translators: %s: support forums URL */ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ), @@ -162,24 +164,28 @@ if ( ! empty( $wp_local_package ) && isset( $languages[ $wp_local_package ] ) ) { if ( isset( $languages[ $wp_local_package ] ) ) { $language = $languages[ $wp_local_package ]; - printf( '' . "\n", + printf( + '' . "\n", esc_attr( $language['language'] ), esc_attr( current( $language['iso'] ) ), esc_attr( $language['strings']['continue'] ), in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '', - esc_html( $language['native_name'] ) ); + esc_html( $language['native_name'] ) + ); unset( $languages[ $wp_local_package ] ); } } foreach ( $languages as $language ) { - printf( '' . "\n", + printf( + '' . "\n", esc_attr( $language['language'] ), esc_attr( current( $language['iso'] ) ), esc_attr( $language['strings']['continue'] ), in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '', - esc_html( $language['native_name'] ) ); + esc_html( $language['native_name'] ) + ); } echo "\n"; echo '

'; @@ -224,10 +230,10 @@ $translation = (object) $translation; require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - $skin = new Automatic_Upgrader_Skin; - $upgrader = new Language_Pack_Upgrader( $skin ); + $skin = new Automatic_Upgrader_Skin; + $upgrader = new Language_Pack_Upgrader( $skin ); $translation->type = 'core'; - $result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) ); + $result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) ); if ( ! $result || is_wp_error( $result ) ) { return false; @@ -250,7 +256,7 @@ } require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - $skin = new Automatic_Upgrader_Skin; + $skin = new Automatic_Upgrader_Skin; $upgrader = new Language_Pack_Upgrader( $skin ); $upgrader->init();