Commit Graph

337 Commits

Author SHA1 Message Date
Stanislav Malyshev
2301608736 Syncronize with 5.6 - __toString should return "" 2016-10-12 23:09:49 -07:00
Nikita Popov
c38f88ddb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-22 12:48:38 +02:00
Márcio Almada
4397306b32 fix bug related to #865
In case USE_KEY flag is active, RegexIterator->accept() should keep it's
old behavior which is to accept keys mapping arrays.

This broke after PHP 5.5 but was not noticed due to lack of tests for USE_KEY.
2016-09-22 12:46:19 +02:00
Pierrick Charron
2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron
4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Loz Calver
f5ccd71d0c Fix 72122 - don't use EH_THROW for calls to getIterator 2016-07-12 10:10:35 +02:00
Xinchen Hui
7648f20de3 Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as expected) 2016-04-19 10:59:10 +08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
27aef97f65 Fixed bug #70868 (PCRE JIT and pattern reuse segfault) 2015-11-06 11:37:17 +08:00
Dmitry Stogov
ad4fa8f758 Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P(). 2015-09-24 22:39:59 +03:00
Dmitry Stogov
c72559ddf6 Cleanup: removed deprecated commented code 2015-09-22 17:02:25 +03:00
Xinchen Hui
fff374feba Merge branch 'PHP-5.6'
Conflicts:
	ext/spl/spl_iterators.c
2015-07-07 21:28:51 +08:00
Xinchen Hui
e41f600365 Fixed bug #69970 (Use-after-free vulnerability in spl_recursive_it_move_forward_ex()) 2015-07-07 21:25:28 +08:00
Dmitry Stogov
53403fe56d Get rid of ZVAL_ZVAL() macro usages. Replace them with more clear and optimal equialent sequences. 2015-07-01 02:05:21 +03:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Rasmus Lerdorf
28d7bb97a1 Fix more proto comments 2015-06-23 17:46:20 -04:00
Nikita Popov
fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Nikita Popov
b4b872f4c9 Fix leak in RecursiveRegexIterator::getChildren() 2015-04-15 20:03:15 +02:00
Nikita Popov
7605e02e3b Fix leaks in recursive iterator construction 2015-04-15 19:51:02 +02:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Dmitry Stogov
48deb1cd94 Free memory if destructor wasn't called 2015-03-11 00:57:28 +03:00
Dmitry Stogov
4241a090ad Avoid reallocation in preg_replace() if nothing was replaced 2015-02-10 13:30:25 +03:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Dmitry Stogov
3e31838d19 zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
2015-01-22 11:50:42 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Stanislav Malyshev
8d26c53f7c Fix bug #68816 - pointer to local outside of scope 2015-01-14 16:14:43 -08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
110cf649b7 fix datatype mismatches
especially spl_dual_it_object current.pos should have the same datatype as
limit.offset, also this doesn't increase the struct size.
2014-10-29 15:30:12 +01:00
Tjerk Meesters
1f4f2ef403 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68128

Conflicts:
	ext/spl/spl_iterators.c
2014-10-14 23:00:17 +08:00
Tjerk Meesters
fb35d7c56e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68128
2014-10-14 22:50:07 +08:00
Tjerk Meesters
71ba533640 Fixed bug #68128
Three issues are addressed:

- RecursiveRegexIterator::accept() should accept non-empty arrays without
  applying any regular expression and RegexIterator::accept() should not accept
  an array.
- RegexIterator::accept() should not accept an atom that fails to match
  anything, even when PREG_PATTERN_ORDER is used (which would return an array
  of empty arrays).
- RecursiveRegexIterator::getChildren() should pass all constructor arguments
  to its child iterator instead of just the regular expression.
2014-10-14 22:49:01 +08:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
90d6f60bc1 mostly fixes to spl, but also some other 2014-08-17 13:31:39 +02:00
Anatol Belski
cb25136f4e fix macros in the 5 basic extensions 2014-08-16 11:37:14 +02:00
Dmitry Stogov
a08b7b7701 cleanup 2014-08-13 19:43:34 +04:00
Dmitry Stogov
05eaed4345 Merge branch 'master' into phpng
* master:
  fix the failing date tests introduced with the latest timezonedb update Derick confirmed on irc that the new/current behavior is the correct and that the tests should be updated to reflect it
  Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
2014-08-12 14:46:38 +04:00
Xinchen Hui
dc06b4f941 Merge branch 'PHP-5.6' 2014-08-11 17:47:47 +08:00
Xinchen Hui
1f496744ed Merge branch 'PHP-5.5' into PHP-5.6 2014-08-11 17:47:36 +08:00
Xinchen Hui
b6ddcf9c71 Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message) 2014-08-11 17:46:56 +08:00