mirror of
https://github.com/php/php-src.git
synced 2024-11-30 05:13:56 +08:00
fix #36359 (splFileObject::fwrite() doesn't write when no data length specified)
This commit is contained in:
parent
a5883cc89c
commit
50bbedcec3
@ -1809,13 +1809,13 @@ SPL_METHOD(SplFileObject, fwrite)
|
||||
char *str;
|
||||
int str_len;
|
||||
int ret;
|
||||
long length;
|
||||
long length = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() < 2) {
|
||||
if (ZEND_NUM_ARGS() > 1) {
|
||||
str_len = MAX(0, MIN(length, str_len));
|
||||
}
|
||||
if (!str_len) {
|
||||
|
Loading…
Reference in New Issue
Block a user