- Fixed ability to use "internal" heaps in extensions. (Arnaud, Dmitry)
- Updated timezone database to version 2008.9. (Derick)
+- Fixed bug #46426 (3rd parameter offset of stream_get_contents not works for
+ "0"). (Felipe)
- Fixed bug #46406 (Unregistering nodeclass throws E_FATAL). (Rob)
- Fixed bug #46389 (NetWare needs small patch for _timezone).
(patch by guenter@php.net)
php_stream_from_zval(stream, &zsrc);
- if (pos > 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) {
+ if (pos >= 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream", pos);
RETURN_FALSE;
}
--- /dev/null
+--TEST--
+Bug #46426 (3rd parameter offset of stream_get_contents not works for "0")
+--FILE--
+<?php
+
+$tmp = tmpfile();
+
+fwrite($tmp, "12345");
+
+echo stream_get_contents($tmp, -1, 0);
+echo "\n";
+echo stream_get_contents($tmp, -1, 1);
+echo "\n";
+echo stream_get_contents($tmp, -1, 2);
+
+@unlink($tmp);
+
+?>
+--EXPECT--
+12345
+2345
+345