Skip to content

Commit 3807b2c

Browse files
committed
Promote some warnings from streams to errors.
1 parent 1589266 commit 3807b2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main/streams/plain_wrapper.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen
10291029

10301030
if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) {
10311031
if (options & REPORT_ERRORS) {
1032-
php_error_docref(NULL, E_WARNING, "`%s' is not a valid mode for fopen", mode);
1032+
zend_value_error("`%s' is not a valid mode for fopen", mode);
10331033
}
10341034
return NULL;
10351035
}
@@ -1464,7 +1464,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
14641464
ret = VCWD_CHMOD(url, mode);
14651465
break;
14661466
default:
1467-
php_error_docref1(NULL, url, E_WARNING, "Unknown option %d for stream_metadata", option);
1467+
zend_value_error("Unknown option %d for stream_metadata", option);
14681468
return 0;
14691469
}
14701470
if (ret == -1) {
@@ -1561,6 +1561,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char
15611561
*(cwd+3) = '\0';
15621562

15631563
if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) {
1564+
/* Raise to warning? */
15641565
php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
15651566
}
15661567

@@ -1616,6 +1617,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char
16161617
goto stream_skip;
16171618
}
16181619
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
1620+
/* Raise to warning? */
16191621
php_error_docref(NULL, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
16201622
}
16211623

0 commit comments

Comments
 (0)