Make WordPress Core


Ignore:
Timestamp:
01/24/2018 10:41:58 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Role/Capability: Make install_languages capability check less restrictive.

A user should still be able to have the capability, even when language packs cannot be automatically installed. The automatic installation part is separate from that now.

Props flixos90.
Fixes #42697.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r42343 r42606  
    188188            require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
    189189
    190             $language = wp_download_language_pack( $_POST['WPLANG'] );
    191             if ( $language ) {
    192                 $_POST['WPLANG'] = $language;
     190            if ( wp_can_install_language_pack() ) {
     191                $language = wp_download_language_pack( $_POST['WPLANG'] );
     192                if ( $language ) {
     193                    $_POST['WPLANG'] = $language;
     194                }
    193195            }
    194196        }
Note: See TracChangeset for help on using the changeset viewer.