Make WordPress Core

Ticket #37436: 37436.3.diff

File 37436.3.diff, 5.2 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/includes/class-wp-automatic-updater.php

    diff --git src/wp-admin/includes/class-wp-automatic-updater.php src/wp-admin/includes/class-wp-automatic-updater.php
    index ea2d70c..bd3a6b6 100644
    class WP_Automatic_Updater { 
    3131         */
    3232        public function is_disabled() {
    3333                // Background updates are disabled if you don't want file changes.
    34                 if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
     34                if ( wp_disallow_file_mods() ) {
    3535                        return true;
     36                }
    3637
    3738                if ( wp_installing() )
    3839                        return true;
  • src/wp-admin/includes/dashboard.php

    diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
    index f3d2f79..18bb565 100644
    function wp_dashboard_primary() { 
    11491149                )
    11501150        );
    11511151
    1152         if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
     1152        if ( ! wp_disallow_file_mods() && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
    11531153                $feeds['plugins'] = array(
    11541154                        'link'         => '',
    11551155                        'url'          => array(
  • src/wp-admin/includes/translation-install.php

    diff --git src/wp-admin/includes/translation-install.php src/wp-admin/includes/translation-install.php
    index ee8254d..91f641d 100644
    function wp_download_language_pack( $download ) { 
    181181                return $download;
    182182        }
    183183
    184         if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
     184        if ( wp_disallow_file_mods() ) {
    185185                return false;
    186186        }
    187187
    function wp_download_language_pack( $download ) { 
    224224 * @return bool Returns true on success, false on failure.
    225225 */
    226226function wp_can_install_language_pack() {
    227         if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
     227        if ( wp_disallow_file_mods() ) {
    228228                return false;
    229229        }
    230230
  • src/wp-admin/includes/upgrade.php

    diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
    index 6b04963..fb33765 100644
    function upgrade_all() { 
    559559        if ( $wp_current_db_version < 37965 )
    560560                upgrade_460();
    561561
     562        if ( $wp_current_db_version < 38613 )
     563                upgrade_470();
     564
    562565        maybe_disable_link_manager();
    563566
    564567        maybe_disable_automattic_widgets();
    function upgrade_460() { 
    17271730}
    17281731
    17291732/**
     1733 * Executes changes made in WordPress 4.7.0.
     1734 *
     1735 * @ignore
     1736 * @since 4.6.0
     1737 *
     1738 * @global int $wp_current_db_version Current database version.
     1739 */
     1740function upgrade_470() {
     1741        global $wp_current_db_version;
     1742
     1743        // Remove unused post meta.
     1744        if ( $wp_current_db_version < 38613 ) {
     1745                delete_transient( $cache_key = 'dash_' . md5( 'dashboard_primary_' . get_locale() ) );
     1746        }
     1747}
     1748
     1749/**
    17301750 * Executes network-level upgrade routines.
    17311751 *
    17321752 * @since 3.0.0
  • src/wp-includes/capabilities.php

    diff --git src/wp-includes/capabilities.php src/wp-includes/capabilities.php
    index da54229..51e9ab1 100644
    function map_meta_cap( $cap, $user_id ) { 
    333333        case 'edit_plugins':
    334334        case 'edit_themes':
    335335                // Disallow the file editors.
    336                 if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
     336                if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {
    337337                        $caps[] = 'do_not_allow';
    338                 elseif ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
     338                } elseif ( wp_disallow_file_mods() ) {
    339339                        $caps[] = 'do_not_allow';
    340                 elseif ( is_multisite() && ! is_super_admin( $user_id ) )
     340                } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
    341341                        $caps[] = 'do_not_allow';
    342                 else
     342                } else {
    343343                        $caps[] = $cap;
     344                }
    344345                break;
    345346        case 'update_plugins':
    346347        case 'delete_plugins':
    function map_meta_cap( $cap, $user_id ) { 
    353354        case 'update_core':
    354355                // Disallow anything that creates, deletes, or updates core, plugin, or theme files.
    355356                // Files in uploads are excepted.
    356                 if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
     357                if ( wp_disallow_file_mods() ) {
    357358                        $caps[] = 'do_not_allow';
    358359                } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
    359360                        $caps[] = 'do_not_allow';
  • src/wp-includes/load.php

    diff --git src/wp-includes/load.php src/wp-includes/load.php
    index fbed09c..cb69256 100644
    function wp_doing_ajax() { 
    10561056}
    10571057
    10581058/**
     1059 * Determines whether file modifications are disallowed.
     1060 *
     1061 * @since 4.7.0
     1062 *
     1063 * @return bool True if file modifications are disallowed, false otherwise.
     1064 */
     1065function wp_disallow_file_mods() {
     1066        return defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS;
     1067}
     1068
     1069/**
    10591070 * Check whether variable is a WordPress Error.
    10601071 *
    10611072 * Returns true if $thing is an object of the WP_Error class.
  • src/wp-includes/version.php

    diff --git src/wp-includes/version.php src/wp-includes/version.php
    index c616729..4b44e08 100644
    $wp_version = '4.7-alpha-38178-src'; 
    1111 *
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 38590;
     14$wp_db_version = 38613;
    1515
    1616/**
    1717 * Holds the TinyMCE version