-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't workingfeatureNew feature or requestNew feature or request
Milestone
Description
The usage of mkdir in Utils\FileManager.php is incorrect:
if ( $this->initialized(true, 'is_dir') ) {
foreach ( $directories as $directory ) {
if ( !$wp_filesystem->is_dir( $directory ) ) {
$wp_filesystem->mkdir( $directory, 0755, true );
}
}
} else {
foreach ( $directories as $directory ) {
if ( !is_dir($directory) ) {
@mkdir($directory, 0755, true); // @phpcs:ignore
}
}
}The file system wrapper is not neccessary here, also $wp_filesystem->mkdir( $directory, 0755, true ) in not recursive. This should be replaced with something like:
foreach ( $directories as $directory ) {
if ( !is_dir($directory) ) {
if ( !wp_mkdir_p($directory) ) {
@mkdir($directory, 0755, true); // @phpcs:ignore
}
}
}- Make the change
- Test under many different permissions and folder structures
-
Add a notification to the back-end to make the missing directories and permissions if the directories does not existInstead of notifications keep the current way of loading from source gracefully
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfeatureNew feature or requestNew feature or request
Type
Projects
Status
Done