Skip to content

Commit 830c442

Browse files
committed
allow empty mkdir param
1 parent 4c5939c commit 830c442

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [Next]
5+
6+
### Changed:
7+
- Allows mkdir method to get empty parameter.
8+
9+
## 1.1.3 - 15.06.2020
10+
11+
### Fixed:
12+
- WP_CONTENT_URL not returning proper protocol. Replaced with `content_url()`, thanks to @matt-bernhardt
13+
414
## 1.1.3 - 15.06.2020
515

616
### Fixed:

src/Filesystem.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function __call( $method_name, $arguments ) {
136136
* @param bool $recursive Whether to act recursively.
137137
* @return bool True on success, false on failure.
138138
*/
139-
public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false, $recursive = false ) {
139+
public function mkdir( $path = '', $chmod = false, $chown = false, $chgrp = false, $recursive = false ) {
140140

141141
if ( ! self::$wp_filesystem instanceof \WP_Filesystem_Direct ) {
142142
if ( $recursive ) {
@@ -148,9 +148,6 @@ public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false, $r
148148

149149
// Safe mode fails with a trailing slash under certain PHP versions.
150150
$path = untrailingslashit( $path );
151-
if ( empty( $path ) ) {
152-
return false;
153-
}
154151

155152
if ( ! $chmod ) {
156153
$chmod = FS_CHMOD_DIR;

0 commit comments

Comments
 (0)