- Improved upon r309729.
- Extented strategy to remaining the classes on spl_directory.c, even those that don't crash.
- UPGRADING.
- Better bug54384.phpt, with all the classes covered.
Arnaud Le Blanc [Sun, 27 Mar 2011 20:13:27 +0000 (20:13 +0000)]
Added CallbackFilterIterator and RecursiveCallbackFilterIterator classes
[DOC] This is a concrete FilterIterator which takes a callback as
constructor parameter, and uses this callback for filtering. This allows
to use FilterIterator without extending it.
CallbackFilterIterator Example:
$it = new ArrayIterator(range(1,100));
$it = new CallbackFilterIterator($it, function($value) {
return $value % 2;
});
foreach($it as $value) // ...
RecursiveCallbackFilterIterator Example:
$it = new RecursiveDirectoryIterator("/");
$it = new RecursiveCallbackFilterIterator($it, function($file, $k, $it) {
return $it->hasChildren() || $file->getSize() > 1024;
});
foreach(new RecursiveIteratorIterator($it) as $file) // ...
The callback takes the current value, the current key and the inner
iterator as parameters.
- Fixed bug #54384: Several SPL classes crash when parent constructor is
not called.
#Merge to 5.3 pending (slight BC break on AppendIterator, as it's no
#longer possible to defer the call to the parent constructor until
#after the constructor is performed).
#Bugs fixed in an atypical way for SPL. The parent constructor call
#check is performed at construction time by using a wrapper constructor
#instead of a check on the beginning of each instance method.
#Perhaps this should be uniformized in trunk; this method was mainly
#applied only to the ones crashing, except a few iterators (at least
#AppendIterator and RecursiveIteratorIterator).
Ulf Wendel [Fri, 25 Mar 2011 10:45:28 +0000 (10:45 +0000)]
Update of mysqlnd version. This has been forgotten when introducing set_autocommit, tx_commit, tx_rollback calls (http://svn.php.net/viewvc?view=revision&revision=308669).
Andrey Hristov [Thu, 24 Mar 2011 16:12:18 +0000 (16:12 +0000)]
fix buffer overflow - overwriting with 0x0, due to
unchecked buffer size. This can be easily workarouned on
existing unpatched systems by increasing
mysqlnd.net_cmd_buffer_size ini variable to more than 8k
Adam Harvey [Wed, 23 Mar 2011 08:43:36 +0000 (08:43 +0000)]
Update test that now generates a warning after r306931, which increased the
error you get when silently casting an empty variable to an object to an
E_WARNING from E_STRICT.
- Make fclose() actually close stream, even when the resource refcount is > 1.
This reverts the fix for bug #24557.
- Make php_stream_free delete the stream from the resources list, not merely
decrease its refcount, as a single call to zend_list_delete does.
#Not worth the risk merging to 5.3. While change #2 may prevent some segfaults,
#a quick and dirty survey to the codebase only showed calls to php_stream_close
#or php_stream_free on streams allocated in the same function, which would have
#refcount == 1. May be reconsidered.
- Fixed bug #54332 (trunk only, null pointer deref due to information loss on long to int conversion)
- Fixed some int* pointers being passed as size_t*.
Ulf Wendel [Thu, 17 Mar 2011 15:18:22 +0000 (15:18 +0000)]
Test coverage for some of the cases where LAST_INSERT_ID() and API *_insert_id() differ as documented in the MySQL manual in particular the C API reference section
- Fixed bug #54092 (Segmentation fault when using HTTP proxy with the FTP
wrapper).
#php_stream->wrapperdata should hold an array zval (like its zval* type
#indicates...), it's not a place where the wrapper can drop an arbitrary
#pointer. For that, .wrapperthis should be used.
#Also, since the ftp dir wrapper defines its own stream type, it's more
#appropriate to use .abstract to store the stream instance specific data.
Boris Lytochkin [Sat, 26 Feb 2011 08:27:26 +0000 (08:27 +0000)]
* new methods get_errno, get_error to get errno and error string
of last SNMP-related error
* formatting markup
* some fixes in max_oids logic: NULL will set it to default value,
do not allow non-positive user-supplied values
* unit tests for changes