Make WordPress Core


Ignore:
Timestamp:
11/19/2014 05:39:52 AM (10 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/includes/class-wp-upgrader-skins.php

    r30170 r30384  
    4141    }
    4242
    43     public function request_filesystem_credentials($error = false) {
     43    public function request_filesystem_credentials( $error = false, $context = false, $allow_relaxed_file_ownership = false ) {
    4444        $url = $this->options['url'];
    45         $context = $this->options['context'];
    46         if ( !empty($this->options['nonce']) )
     45        if ( ! $context ) {
     46            $context = $this->options['context'];
     47        }
     48        if ( !empty($this->options['nonce']) ) {
    4749            $url = wp_nonce_url($url, $this->options['nonce']);
    48         return request_filesystem_credentials($url, '', $error, $context); //Possible to bring inline, Leaving as is for now.
     50        }
     51
     52        $extra_fields = array();
     53
     54        return request_filesystem_credentials( $url, '', $error, $context, $extra_fields, $allow_relaxed_file_ownership );
    4955    }
    5056
     
    700706    protected $messages = array();
    701707
    702     public function request_filesystem_credentials( $error = false, $context = '' ) {
    703         if ( $context )
     708    public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
     709        if ( $context ) {
    704710            $this->options['context'] = $context;
     711        }
    705712        // TODO: fix up request_filesystem_credentials(), or split it, to allow us to request a no-output version
    706713        // This will output a credentials form in event of failure, We don't want that, so just hide with a buffer
    707714        ob_start();
    708         $result = parent::request_filesystem_credentials( $error );
     715        $result = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
    709716        ob_end_clean();
    710717        return $result;
Note: See TracChangeset for help on using the changeset viewer.