Branch: PHP-5.5.4 Deleted commits count: 1 User: JulienPauli <jpa...@php.net> Wed, 18 Sep 2013 13:19:49 +0000
Changed paths: M ext/filter/logical_filters.c M ext/spl/internal/emptyiterator.inc M ext/spl/spl_iterators.c D ext/spl/tests/bug60577.phpt M main/fopen_wrappers.c Diff: diff --git b/ext/filter/logical_filters.c a/ext/filter/logical_filters.c index 0e3297b..653cce2 100644 --- b/ext/filter/logical_filters.c +++ a/ext/filter/logical_filters.c @@ -714,7 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_RES_RANGE) { if ( (ip[0] == 0) || - (ip[0] == 100 && (ip[1] == 0 || ip[1] <= 127)) || + (ip[0] == 100 && (ip[1] >= 64 || ip[1] <= 127)) || (ip[0] == 128 && ip[1] == 0) || (ip[0] == 191 && ip[1] == 255) || (ip[0] == 169 && ip[1] == 254) || diff --git b/ext/spl/internal/emptyiterator.inc a/ext/spl/internal/emptyiterator.inc index d02b15b..ac80e79 100644 --- b/ext/spl/internal/emptyiterator.inc +++ a/ext/spl/internal/emptyiterator.inc @@ -15,7 +15,7 @@ * @version 1.0 * @since PHP 5.1 */ -class EmptyIterator implements Iterator, Countable +class EmptyIterator implements Iterator { /** No operation. * @return void @@ -57,15 +57,6 @@ class EmptyIterator implements Iterator, Countable { // nothing to do } - - /** - * @return int - */ - function count() - { - return 0; - } - } -?> +?> \ No newline at end of file diff --git b/ext/spl/spl_iterators.c a/ext/spl/spl_iterators.c index 476c64e..3053275 100644 --- b/ext/spl/spl_iterators.c +++ a/ext/spl/spl_iterators.c @@ -3241,23 +3241,12 @@ SPL_METHOD(EmptyIterator, next) } } /* }}} */ -/* {{{ proto int EmptyIterator::count() - Does nothing */ -SPL_METHOD(EmptyIterator, count) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - RETURN_LONG(0); -} /* }}} */ - static const zend_function_entry spl_funcs_EmptyIterator[] = { SPL_ME(EmptyIterator, rewind, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(EmptyIterator, valid, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(EmptyIterator, key, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(EmptyIterator, current, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(EmptyIterator, next, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) - SPL_ME(EmptyIterator, count, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -3718,7 +3707,6 @@ PHP_MINIT_FUNCTION(spl_iterators) REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator); REGISTER_SPL_ITERATOR(EmptyIterator); - REGISTER_SPL_IMPLEMENTS(EmptyIterator, Countable); REGISTER_SPL_SUB_CLASS_EX(RecursiveTreeIterator, RecursiveIteratorIterator, spl_RecursiveTreeIterator_new, spl_funcs_RecursiveTreeIterator); REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_CURRENT", RTIT_BYPASS_CURRENT); diff --git b/ext/spl/tests/bug60577.phpt a/ext/spl/tests/bug60577.phpt deleted file mode 100644 index 33fc133..0000000 --- b/ext/spl/tests/bug60577.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -count(new EmptyIterator) should return zero ---FILE-- -<?php -$it = new EmptyIterator; -var_dump(count($it)); ---EXPECT-- -int(0) diff --git b/main/fopen_wrappers.c a/main/fopen_wrappers.c index 6f11cf3..9b8645a 100644 --- b/main/fopen_wrappers.c +++ a/main/fopen_wrappers.c @@ -775,7 +775,12 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co * we cannot cannot getcwd() and the requested, * relatively referenced file is accessible */ copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); - real_path = estrndup(filepath, copy_len); + if (real_path) { + memcpy(real_path, filepath, copy_len); + real_path[copy_len] = '\0'; + } else { + real_path = estrndup(filepath, copy_len); + } close(fdtest); return real_path; } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php