Make WordPress Core


Ignore:
Timestamp:
11/19/2014 05:39:52 AM (12 years ago)
Author:
dd32
Message:

Background Updates: Introduce support to take advantage of Group Writable (or World Writable) to Core Background updates.
This is only enabled when new files will not be installed during the update (as indicated by the WordPress.org API), and does not apply to Plugin/Theme/Translation Background Updates.

Additionally, the code to determine if the 'direct' filesystem transport should be used has been tweaked for wider support (where getmyuid() was unavailalbe) which fixes #10424

See #10205, #30245

File:
1 edited

Legend:

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

    r29825 r30384  
    382382                return;
    383383
     384        // Allow relaxed file ownership writes for User-initiated upgrades when the API specifies
     385        // that it's safe to do so. This only happens when there are no new files to create.
     386        $allow_relaxed_file_ownership = ! $reinstall && isset( $update->new_files ) && ! $update->new_files;
     387
    384388?>
    385389        <div class="wrap">
    … …  
    387391<?php
    388392
    389         if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH ) ) ) {
     393        if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array(), $allow_relaxed_file_ownership ) ) ) {
    390394                echo '</div>';
    391395                return;
    392396        }
    393397
    394         if ( ! WP_Filesystem( $credentials, ABSPATH ) ) {
     398        if ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) {
    395399                // Failed to connect, Error and request again
    396                 request_filesystem_credentials( $url, '', true, ABSPATH );
     400                request_filesystem_credentials( $url, '', true, ABSPATH, array(), $allow_relaxed_file_ownership );
    397401                echo '</div>';
    398402                return;
    … …  
    412416
    413417        $upgrader = new Core_Upgrader();
    414         $result = $upgrader->upgrade( $update );
     418        $result = $upgrader->upgrade( $update, array(
     419                'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership
     420        ) );
    415421
    416422        if ( is_wp_error($result) ) {
Note: See TracChangeset for help on using the changeset viewer.