@@ -915,18 +915,14 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i
915915
916916 stream = php_ftp_fopen_connect (wrapper , url , "r" , 0 , NULL , context , NULL , & resource , NULL , NULL );
917917 if (!stream ) {
918- if (options & REPORT_ERRORS ) {
919- php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
920- "Unable to connect to %s" , url );
921- }
918+ php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
919+ "Unable to connect to %s" , url );
922920 goto unlink_errexit ;
923921 }
924922
925923 if (resource -> path == NULL ) {
926- if (options & REPORT_ERRORS ) {
927- php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
928- "Invalid path provided in %s" , url );
929- }
924+ php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
925+ "Invalid path provided in %s" , url );
930926 goto unlink_errexit ;
931927 }
932928
@@ -935,10 +931,8 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i
935931
936932 result = GET_FTP_RESULT (stream );
937933 if (result < 200 || result > 299 ) {
938- if (options & REPORT_ERRORS ) {
939- php_stream_wrapper_warn (wrapper , context , options , UnlinkFailed ,
940- "Error Deleting file: %s" , tmp_line );
941- }
934+ php_stream_wrapper_warn (wrapper , context , options , UnlinkFailed ,
935+ "Error Deleting file: %s" , tmp_line );
942936 goto unlink_errexit ;
943937 }
944938
@@ -1000,10 +994,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
1000994
1001995 stream = php_ftp_fopen_connect (wrapper , url_from , "r" , 0 , NULL , context , NULL , NULL , NULL , NULL );
1002996 if (!stream ) {
1003- if (options & REPORT_ERRORS ) {
1004- php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
1005- "Unable to connect to %s" , ZSTR_VAL (resource_from -> host ));
1006- }
997+ php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
998+ "Unable to connect to %s" , ZSTR_VAL (resource_from -> host ));
1007999 goto rename_errexit ;
10081000 }
10091001
@@ -1012,10 +1004,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
10121004
10131005 result = GET_FTP_RESULT (stream );
10141006 if (result < 300 || result > 399 ) {
1015- if (options & REPORT_ERRORS ) {
1016- php_stream_wrapper_warn (wrapper , context , options , RenameFailed ,
1017- "Error Renaming file: %s" , tmp_line );
1018- }
1007+ php_stream_wrapper_warn (wrapper , context , options , RenameFailed ,
1008+ "Error Renaming file: %s" , tmp_line );
10191009 goto rename_errexit ;
10201010 }
10211011
@@ -1024,10 +1014,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
10241014
10251015 result = GET_FTP_RESULT (stream );
10261016 if (result < 200 || result > 299 ) {
1027- if (options & REPORT_ERRORS ) {
1028- php_stream_wrapper_warn (wrapper , context , options , RenameFailed ,
1029- "Error Renaming file: %s" , tmp_line );
1030- }
1017+ php_stream_wrapper_warn (wrapper , context , options , RenameFailed ,
1018+ "Error Renaming file: %s" , tmp_line );
10311019 goto rename_errexit ;
10321020 }
10331021
@@ -1058,18 +1046,14 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
10581046
10591047 stream = php_ftp_fopen_connect (wrapper , url , "r" , 0 , NULL , context , NULL , & resource , NULL , NULL );
10601048 if (!stream ) {
1061- if (options & REPORT_ERRORS ) {
1062- php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
1063- "Unable to connect to %s" , url );
1064- }
1049+ php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
1050+ "Unable to connect to %s" , url );
10651051 goto mkdir_errexit ;
10661052 }
10671053
10681054 if (resource -> path == NULL ) {
1069- if (options & REPORT_ERRORS ) {
1070- php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
1071- "Invalid path provided in %s" , url );
1072- }
1055+ php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
1056+ "Invalid path provided in %s" , url );
10731057 goto mkdir_errexit ;
10741058 }
10751059
@@ -1108,10 +1092,8 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
11081092 php_stream_printf (stream , "MKD %s\r\n" , buf );
11091093 result = GET_FTP_RESULT (stream );
11101094 if (result < 200 || result > 299 ) {
1111- if (options & REPORT_ERRORS ) {
1112- php_stream_wrapper_warn (wrapper , context , options , MkdirFailed ,
1113- "%s" , tmp_line );
1114- }
1095+ php_stream_wrapper_warn (wrapper , context , options , MkdirFailed ,
1096+ "%s" , tmp_line );
11151097 break ;
11161098 }
11171099 }
@@ -1153,29 +1135,23 @@ static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, in
11531135
11541136 stream = php_ftp_fopen_connect (wrapper , url , "r" , 0 , NULL , context , NULL , & resource , NULL , NULL );
11551137 if (!stream ) {
1156- if (options & REPORT_ERRORS ) {
1157- php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
1158- "Unable to connect to %s" , url );
1159- }
1138+ php_stream_wrapper_warn (wrapper , context , options , AuthFailed ,
1139+ "Unable to connect to %s" , url );
11601140 goto rmdir_errexit ;
11611141 }
11621142
11631143 if (resource -> path == NULL ) {
1164- if (options & REPORT_ERRORS ) {
1165- php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
1166- "Invalid path provided in %s" , url );
1167- }
1144+ php_stream_wrapper_warn (wrapper , context , options , InvalidPath ,
1145+ "Invalid path provided in %s" , url );
11681146 goto rmdir_errexit ;
11691147 }
11701148
11711149 php_stream_printf (stream , "RMD %s\r\n" , ZSTR_VAL (resource -> path ));
11721150 result = GET_FTP_RESULT (stream );
11731151
11741152 if (result < 200 || result > 299 ) {
1175- if (options & REPORT_ERRORS ) {
1176- php_stream_wrapper_warn (wrapper , context , options , RmdirFailed ,
1177- "%s" , tmp_line );
1178- }
1153+ php_stream_wrapper_warn (wrapper , context , options , RmdirFailed ,
1154+ "%s" , tmp_line );
11791155 goto rmdir_errexit ;
11801156 }
11811157
0 commit comments