Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#57907 closed defect (bug) (fixed)

Fix WP_Error in copy_dir()

Reported by: afragen's profile afragen Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version: 5.7
Component: Filesystem API Keywords: has-patch commit
Focuses: Cc:

Description

The WP_Error returned for ::dirlist() has an incorrect data argument. It should be based on the $from.

Change History (8)

This ticket was mentioned in PR #4222 on WordPress/wordpress-develop by @afragen.


2 years ago
#1

The WP_Errror returned in copy_dir() for ::dirlist() seems to be incorrect. It should be $from not $to.

Trac ticket: https://core.trac.wordpress.org/ticket/57907

#2 @costdev
2 years ago

  • Milestone changed from Awaiting Review to 6.3

#3 @costdev
2 years ago

  • Keywords commit added

PR 4222 looks good to me. ::dirlist() is run on $from, so basename( $from ) is the correct thing to pass to the WP_Error object.

Marking for commit consideration.

#4 @afragen
2 years ago

  • Version changed from 5.1.1 to 5.7

#5 @pravinparmar2404
2 years ago

Tested the patch and it looks good to me.

#6 @SergeyBiryukov
2 years ago

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

In 55538:

Filesystem API: Return correct error data from copy_dir() if the directory listing failed.

The ::dirlist() method is run on the $from directory, so basename( $from ) is the correct thing to pass to the WP_Error object.

Follow-up to [50149].

Props afragen, costdev, pravinparmar2404.
Fixes #57907.

@SergeyBiryukov commented on PR #4222:


2 years ago
#7

Thanks for the PR! Merged in r55538.

#8 @hellofromTonya
2 years ago

@SergeyBiryukov should this be reopened to backport to 6.2 branch? Never mind, re-read > I thought this was addressing the move dir introduced in 6.2. Sorry for the confusion.

Last edited 2 years ago by hellofromTonya (previous) (diff)
Note: See TracTickets for help on using tickets.