[wp-trac] [WordPress Trac] #41855: copy_dir fails in coping some files in nested dirs
WordPress Trac
noreply at wordpress.org
Fri Jun 16 04:31:20 UTC 2023
#41855: copy_dir fails in coping some files in nested dirs
-------------------------------------------------+-------------------------
Reporter: caraffande | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.3
Component: Filesystem API | Version: 4.8.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests has- | Focuses:
testing-info commit |
-------------------------------------------------+-------------------------
Comment (by peterwilsoncc):
== Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/4221
=== Environment
- Filesystem: Direct
- OS: Linux 5.15.0-30-generic x86_64
- Web Server: nginx/1.18.0
- PHP: 7.4.33
- WordPress: 6.3-alpha-55505-src
- Browser: Safari 15.4
- Theme: Twenty Twenty-Three
- Active Plugins: None
=== Testing procedure ===
1. Create directory `wp-content/empty`
1. Run following in `wp shell`
{{{
WP_Filesystem();
copy_dir( '/vagrant/content/plugins', '/vagrant/content/empty/plugins' );
}}}
=== Actual Results
- ✅ Verified report: First block of code fails
- ✅ Verified patch: First block of code succeeds with PR checked out.
=== Additional Notes
I also ran the following test attempting to copy the folder in to a sub-
directory of a directory that doesn't exist:
1. Empty directory `wp-content/empty`
1. Run following in `wp shell`
{{{
WP_Filesystem();
copy_dir( '/vagrant/content/plugins', '/vagrant/content/empty/sub-
folder/plugins' );
}}}
With the PR applied, this fails as the call to the PHP function `mkdir()`
doesn't use the recursive function. Honestly, I think this is fine.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41855#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list