WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#37412 closed defect (bug) (fixed)

Change default value of $context to empty string for request_filesystem_credentials() and get_filesystem_method()

Reported by: ocean90 Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Filesystem API Keywords: has-patch
Focuses: docs Cc:
PR Number:

Description

$context is a path to a directory and shouldn't be false by default.

Automatic_Upgrader_Skin::request_filesystem_credentials() and WP_Upgrader_Skin::request_filesystem_credentials() need to be updated too.

Attachments (3)

37412.patch (5.5 KB) - added by ocean90 4 years ago.
37412.2.patch (5.8 KB) - added by ocean90 4 years ago.
37412.diff (7.3 KB) - added by DrewAPicture 4 years ago.

Download all attachments as: .zip

Change History (8)

@ocean90
4 years ago

@ocean90
4 years ago

#1 @ocean90
4 years ago

@DrewAPicture How does 37412.2.patch look to you?

This ticket was mentioned in Slack in #core by drew. View the logs.


4 years ago

@DrewAPicture
4 years ago

#3 @DrewAPicture
4 years ago

  • Keywords has-patch added

@ocean90 Since we're changing the default for $context, 37412.diff adds changelog entries to the function DocBlocks and as well as DocBlocks for hooks that would additionally be affected by the change.

It might seem like a lot of ground to cover, but anybody relying on $context defaulting to false in the resulting hooks should get some kind of explanation.

#4 @ocean90
4 years ago

  • Milestone changed from Awaiting Review to 4.6

#5 @ocean90
4 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 38138:

Filesystem API: Change the default value for the $context parameter of get_filesystem_method() and request_filesystem_credentials() to an empty string.

$context is a full path to the directory that is tested for being writable. A path shouldn't be a boolean value.
This also updates WP_Upgrader_Skin::request_filesystem_credentials() and Automatic_Upgrader_Skin::request_filesystem_credentials() and adds missing docs.

Props DrewAPicture, ocean90.
Fixes #37412.

Note: See TracTickets for help on using tickets.