File tree 4 files changed +76
-2
lines changed
4 files changed +76
-2
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #27809: ftp_systype returns null
3
+ --SKIPIF--
4
+ <?php
5
+ require 'skipif.inc ' ;
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ bug27809 =true ;
10
+ require 'server.inc ' ;
11
+
12
+ $ ftp = ftp_connect ('127.0.0.1 ' , $ port );
13
+ if (!$ ftp ) die ("Couldn't connect to the server " );
14
+
15
+ var_dump (ftp_login ($ ftp , 'anonymous ' , 'IEUser@ ' ));
16
+ var_dump (ftp_systype ($ ftp ));
17
+
18
+ ?>
19
+ --EXPECT--
20
+ bool(true)
21
+ string(6) "OS/400"
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #7216: ftp_mkdir returns nothing (2)
3
+ --SKIPIF--
4
+ <?php
5
+ require 'skipif.inc ' ;
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ require 'server.inc ' ;
10
+
11
+ $ ftp = ftp_connect ('127.0.0.1 ' , $ port );
12
+ if (!$ ftp ) die ("Couldn't connect to the server " );
13
+
14
+ var_dump (ftp_login ($ ftp , 'anonymous ' , 'IEUser@ ' ));
15
+ // test for the correct behavior this time
16
+ var_dump (ftp_mkdir ($ ftp , 'CVS ' ));
17
+
18
+ ?>
19
+ --EXPECTREGEX--
20
+ bool\(true\)
21
+ string\(\d+\) ".+[\/\\]CVS"
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #7216: ftp_mkdir returns nothing
3
+ --SKIPIF--
4
+ <?php
5
+ require 'skipif.inc ' ;
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ bug7216 =true ;
10
+ require 'server.inc ' ;
11
+
12
+ $ ftp = ftp_connect ('127.0.0.1 ' , $ port );
13
+ if (!$ ftp ) die ("Couldn't connect to the server " );
14
+
15
+ var_dump (ftp_login ($ ftp , 'anonymous ' , 'IEUser@ ' ));
16
+ var_dump (ftp_mkdir ($ ftp , 'CVS ' ));
17
+
18
+ ?>
19
+ --EXPECT--
20
+ bool(true)
21
+ string(3) "CVS"
Original file line number Diff line number Diff line change @@ -151,7 +151,11 @@ while($buf = fread($s, 4098)) {
151
151
fputs ($ s , "250 CDUP command successful. \r\n" );
152
152
153
153
} elseif ($ buf === "SYST \r\n" ) {
154
- fputs ($ s , "215 UNIX Type: L8. \r\n" );
154
+ if (isset ($ bug27809 )) {
155
+ fputs ($ s , "215 OS/400 is the remote operating system. The TCP/IP version is \"V5R2M0 \"\r\n" );
156
+ } else {
157
+ fputs ($ s , "215 UNIX Type: L8. \r\n" );
158
+ }
155
159
156
160
} elseif ($ buf === "QUIT \r\n" ) {
157
161
break ;
@@ -160,7 +164,14 @@ while($buf = fread($s, 4098)) {
160
164
change_dir ($ m [1 ]);
161
165
fputs ($ s , "250 CWD command successful. \r\n" );
162
166
163
- } else if (preg_match ('/^USER / ' , $ buf )) {
167
+ } elseif (preg_match ("~^MKD ([A-Za-z./]+) \r\n$~ " , $ buf , $ m )) {
168
+ if (isset ($ bug7216 )) {
169
+ fputs ($ s , "257 OK. \r\n" );
170
+ } else {
171
+ fputs ($ s , '257 " ' .realpath ($ m [1 ])."\" created. \r\n" );
172
+ }
173
+
174
+ } elseif (preg_match ('/^USER / ' , $ buf )) {
164
175
user_auth ($ buf );
165
176
166
177
} else {
You can’t perform that action at this time.
0 commit comments