Skip to content

Commit f53e365

Browse files
committed
Promote warnings to exceptions in some URL and file related functions
1 parent 6a4bd43 commit f53e365

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/standard/ftp_fopen_wrapper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
10501050

10511051
if (resource->path == NULL) {
10521052
if (options & REPORT_ERRORS) {
1053-
php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
1053+
zend_value_error("Invalid path provided in %s", url);
10541054
}
10551055
goto mkdir_errexit;
10561056
}
@@ -1143,7 +1143,7 @@ static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, in
11431143

11441144
if (resource->path == NULL) {
11451145
if (options & REPORT_ERRORS) {
1146-
php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
1146+
zend_value_error("Invalid path provided in %s", url);
11471147
}
11481148
goto rmdir_errexit;
11491149
}

ext/standard/php_fopen_wrapper.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
219219

220220
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
221221
if (options & REPORT_ERRORS) {
222-
php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
222+
zend_throw_error(NULL, "URL file-access is disabled in the server configuration");
223223
}
224224
return NULL;
225225
}
@@ -238,7 +238,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
238238
if (!strcasecmp(path, "stdin")) {
239239
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
240240
if (options & REPORT_ERRORS) {
241-
php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
241+
zend_throw_error(NULL, "URL file-access is disabled in the server configuration");
242242
}
243243
return NULL;
244244
}
@@ -297,14 +297,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
297297

298298
if (strcmp(sapi_module.name, "cli")) {
299299
if (options & REPORT_ERRORS) {
300-
php_error_docref(NULL, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
300+
zend_throw_error(NULL, "Direct access to file descriptors is only available from command-line PHP");
301301
}
302302
return NULL;
303303
}
304304

305305
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
306306
if (options & REPORT_ERRORS) {
307-
php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
307+
zend_throw_error(NULL, "URL file-access is disabled in the server configuration");
308308
}
309309
return NULL;
310310
}

0 commit comments

Comments
 (0)