Ticket #29397: 29397.patch
File 29397.patch, 2.2 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/translation-install.php
210 210 $result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) ); 211 211 return $translation->language; 212 212 } 213 214 /** 215 * Check if WordPress has access to the filesystem without asking for 216 * credentials. 217 * 218 * @since 4.0.0 219 * 220 * @return bool Returns true on success false on failure. 221 */ 222 function wp_can_install_language_pack_directly() { 223 if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { 224 return false; 225 } 226 227 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 228 $skin = new Automatic_Upgrader_Skin; 229 $upgrader = new Language_Pack_Upgrader( $skin ); 230 231 $check = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) ); 232 233 if ( ! $check || is_wp_error( $check ) ) { 234 return false; 235 } 236 237 return true; 238 } -
src/wp-admin/install.php
189 189 switch($step) { 190 190 case 0: // Step 0 191 191 192 if ( empty( $langugage ) && ( $languages = wp_get_available_translations() ) ) {192 if ( wp_can_install_language_pack_directly() && empty( $langugage ) && ( $languages = wp_get_available_translations() ) ) { 193 193 display_header( 'language-chooser' ); 194 194 echo '<form id="setup" method="post" action="?step=1">'; 195 195 wp_install_language_form( $languages ); -
src/wp-admin/setup-config.php
95 95 } 96 96 switch($step) { 97 97 case -1: 98 if ( empty( $language ) && ( $languages = wp_get_available_translations() ) ) {98 if ( wp_can_install_language_pack_directly() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) { 99 99 setup_config_display_header( 'language-chooser' ); 100 100 echo '<form id="setup" method="post" action="?step=0">'; 101 101 wp_install_language_form( $languages );