- Removed the E_STRICT deprecation notice from "var". (Ilia)
- Fixed debug_zval_dump() to support private and protected members. (Dmitry)
- Fixed SoapFault::getMessage(). (Dmitry)
+- Fixed bug #36981 (SplFileObject->fgets() ignores max_length). (Tony)
- Fixed bug #36957 (serialize() does not handle recursion). (Ilia)
- Fixed bug #36944 (strncmp & strncasecmp do not return false on negative
string length). (Tony)
static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
{
char *buf;
- size_t line_len;
+ size_t line_len = 0;
int len;
long line_add = (intern->u.file.current_line || intern->u.file.current_zval) ? 1 : 0;
return FAILURE;
}
- buf = php_stream_get_line(intern->u.file.stream, NULL, intern->u.file.max_line_len, &line_len);
+ if (intern->u.file.max_line_len > 0) {
+ buf = emalloc((intern->u.file.max_line_len + 1) * sizeof(char));
+ if (php_stream_get_line(intern->u.file.stream, buf, intern->u.file.max_line_len, &line_len) == NULL) {
+ efree(buf);
+ buf = NULL;
+ } else {
+ buf[line_len] = '\0';
+ }
+ } else {
+ buf = php_stream_get_line(intern->u.file.stream, NULL, 0, &line_len);
+ }
if (!buf) {
intern->u.file.current_line = estrdup("");