-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug #77680: Correctly implement recursive mkdir on FTP stream
If the root directory was missing, an extra CWD without arguments was made. Also, the MKD contained an empty string. Now the CWD will use / and MKDs will be issued starting from the root directory.
- Loading branch information
Showing
4 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--TEST-- | ||
Recursive mkdir() on ftp should create missing directories. | ||
--SKIPIF-- | ||
<?php | ||
if (array_search('ftp',stream_get_wrappers()) === FALSE) die("skip ftp wrapper not available."); | ||
if (!function_exists('pcntl_fork')) die("skip pcntl_fork() not available."); | ||
?> | ||
--FILE-- | ||
<?php | ||
$bug77680=1; | ||
|
||
require __DIR__ . "/../../../ftp/tests/server.inc"; | ||
|
||
$path = "ftp://localhost:" . $port."/one/two/three/"; | ||
mkdir($path, 0755, true); | ||
|
||
?> | ||
==DONE== | ||
--EXPECTF-- | ||
string(20) "CWD /one/two/three | ||
" | ||
string(14) "CWD /one/two | ||
" | ||
string(10) "CWD /one | ||
" | ||
string(7) "CWD / | ||
" | ||
string(7) "MKD / | ||
" | ||
string(10) "MKD /one | ||
" | ||
string(14) "MKD /one/two | ||
" | ||
string(20) "MKD /one/two/three | ||
" | ||
==DONE== |