Commit Graph

605 Commits

Author SHA1 Message Date
Anatol Belski
5d035b57ee fix data types 2015-09-12 18:53:30 +02:00
Anatol Belski
c6ff5be09d add range checks 2015-09-12 10:29:00 +02:00
Christoph M. Becker
1b344f55f4 Revert "Fix #70029: nodeValue of DOMElement list content of children nodes"
This reverts commit 25a52d98d7.
2015-09-06 15:36:43 +02:00
Christoph M. Becker
25a52d98d7 Fix #70029: nodeValue of DOMElement list content of children nodes
According to the W3C DOM Core Level 3 specification DOMElement::nodeValue is
supposed to yield null, but currently the DOM extension yield the result of
calling xmlNodeGetContent(), what is the concatenation of the values of the
children of the element. This patch fixes the non standard behavior.
2015-09-05 01:52:41 +02:00
Christoph M. Becker
c9a8733ce2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #70001: Assigning to DOMNode::textContent does additional entity encoding

Resolved conflicts:
	ext/dom/node.c
2015-09-05 01:32:08 +02:00
Christoph M. Becker
b2954c64ab Fix #70001: Assigning to DOMNode::textContent does additional entity encoding
Assigning to DOMNode::textContent encodes entities, what does not match the
behavior of DOMText::__construct() and DOMDocument::createTextNode. This patch
changes the behavior of DOMNode::textContent in this regard.
2015-09-05 01:17:50 +02:00
Anatol Belski
201afce875 add some range checks to ext/dom 2015-08-26 16:39:50 +02:00
Dmitry Stogov
715d5d2855 Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.
This prevented compilation warnings and disclosed few incorrect usages in Zend/zend_vm_def.h and ext/dom/xpath.c.
Now explicit type casting may be required on call site.
This may break some C extension code, but it shoulfn't be a problem to add explicit casting.
2015-08-13 13:56:29 +03:00
Christoph M. Becker
6576d809a5 test fails with old libxml2; skip in this case 2015-07-31 19:52:42 +02:00
Dmitry Patsura
ed3c7adc5f Remove unneded space(s) 2015-08-03 18:38:41 +08:00
Anatol Belski
545b364d56 remove TSRMLS_*
either remains or merged in from PHP5
2015-08-02 13:42:01 +02:00
Christoph M. Becker
78eab007a9 Merge branch 'PHP-5.6'
* PHP-5.6:
  test fails with old libxml2; skip in this case
2015-07-31 19:55:07 +02:00
Nikita Popov
5c95226d50 Various warning fixes 2015-07-17 20:18:25 +02:00
Rasmus Lerdorf
1af1afdfdc DOMDocument::saveXML has a 2nd optional arg 2015-07-10 15:17:06 -07:00
Aaron Piotrowski
ed1b64877d Switch position of ce in exception ce variable names 2015-07-03 09:45:03 -05:00
Aaron Piotrowski
a812a74c2e Change zend_exception_get_default() to zend_exception_ce 2015-07-03 09:44:48 -05: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
Christoph M. Becker
86df85f43a Merge branch 'PHP-5.6'
* PHP-5.6:
  added regression test for bug #69679
2015-06-27 01:10:41 +02:00
Christoph M. Becker
6400ef192c added regression test for bug #69679
DOMDocument::loadHTML refuses to accept NULL bytes.
2015-06-27 01:08:56 +02:00
Rasmus Lerdorf
41774bceff Fix more minor mistakes in the proto comments 2015-06-23 15:47:33 -04:00
Anatol Belski
1e65b65dd6 more precise way to destroy iterator object
which also fixes the iterator_to_array test
2015-06-19 14:23:32 +02:00
Anatol Belski
9649cec2a3 added test for bug #69846 2015-06-19 12:46:19 +02:00
Anatol Belski
d079a1c9ea better approach to fix bug #69846
don't destroy the current iterator object too early
2015-06-19 11:22:12 +02:00
Anatol Belski
918de41ec2 partial fix to bug #69846 2015-06-18 20:17:04 +02:00
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Stanislav Malyshev
d4407e1cb9 Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS
  Fixed bug #68776
  fix test
  update NEWS
  Fix bug #69646	OS command injection vulnerability in escapeshellarg
  Fix #69719 - more checks for nulls in paths
  fix test description
  Fixed Buf #68812 Unchecked return value.

Conflicts:
	ext/dom/document.c
	ext/gd/gd.c
	ext/standard/exec.c
2015-06-09 21:39:59 -07:00
Stanislav Malyshev
1346c3df42 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
  update NEWS
2015-06-09 17:12:25 -07:00
Stanislav Malyshev
6b53b7cd84 Merge branch 'PHp-5.4' into PHP-5.5
* PHp-5.4:
  fix test
  update NEWS
2015-06-09 17:12:11 -07:00
Stanislav Malyshev
eee8b6c33f fix test 2015-06-09 17:11:33 -07:00
Stanislav Malyshev
8b1919ed73 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #69646	OS command injection vulnerability in escapeshellarg
  Fix #69719 - more checks for nulls in paths
  fix test description
  Fixed Buf #68812 Unchecked return value.
2015-06-09 15:32:27 -07:00
Stanislav Malyshev
4e2fb47092 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69646	OS command injection vulnerability in escapeshellarg
  Fix #69719 - more checks for nulls in paths
  fix test description
  Fixed Buf #68812 Unchecked return value.

Conflicts:
	ext/dom/document.c
	ext/gd/gd.c
2015-06-09 15:31:27 -07:00
Stanislav Malyshev
f7d7befae8 Fix #69719 - more checks for nulls in paths 2015-06-09 10:52:38 -07:00
Aaron Piotrowski
e97d5fab35 Update exception names in tests after formatting changes. 2015-05-17 17:31:43 -05:00
Aaron Piotrowski
fb7206e452 Merge branch 'master' into throwable-interface 2015-05-17 16:15:35 -05:00
Nikita Popov
3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Aaron Piotrowski
64b167d201 Updated tests to reflect exception class changes. 2015-05-16 16:49:14 -05:00
Nikita Popov
c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
Anatol Belski
becfdeb2ff improve searchability for libxml2 headers
and bring the configs inline with the current libxml2 build
2015-05-10 22:22:03 +02:00
Stanislav Malyshev
b3709bfc52 Merge branch 'PHP-5.6'
* PHP-5.6: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	Zend/zend_exceptions.c
	ext/curl/interface.c
	ext/dom/document.c
	ext/fileinfo/libmagic/softmagic.c
	ext/gd/gd.c
	ext/hash/hash.c
	ext/pgsql/pgsql.c
	ext/phar/phar.c
	ext/phar/phar_internal.h
	ext/standard/http_fopen_wrapper.c
	ext/standard/link.c
	ext/standard/streamsfuncs.c
	ext/xmlwriter/php_xmlwriter.c
	ext/zlib/zlib.c
2015-04-14 01:28:06 -07:00
Stanislav Malyshev
5776fceb16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-14 01:05:01 -07:00
Stanislav Malyshev
4782ceea80 Merge branch 'PHp-5.4' into PHP-5.5
* PHp-5.4:
  fix non-standard C
2015-04-14 00:49:23 -07:00
Stanislav Malyshev
9af582bbe0 fix non-standard C 2015-04-14 00:46:47 -07:00
Stanislav Malyshev
0cb9d75cb6 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  Fixed bug #68901 (use after free)
  Fixed bug #68740 (NULL Pointer Dereference)
  Fix bug #66550 (SQLite prepared statement use-after-free)
  Better fix for #68601 for perf 81e9a993f2
  Fix bug #68601 buffer read overflow in gd_gif_in.c
  Revert "Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4"
  Fixed bug #69293
  Add ZEND_ARG_CALLABLE_INFO to allow internal function to type hint against callable.
2015-04-11 16:56:12 -07:00
Stanislav Malyshev
4435b9142f Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) 2015-04-11 16:53:22 -07: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
Xinchen Hui
3ad9ff197d Fixed typos 2015-03-30 16:56:12 +08:00
Xinchen Hui
97956a5d08 Fixed tests 2015-03-30 16:25:41 +08:00
Anatol Belski
c0adad5557 fix exports and shared compilation 2015-03-23 15:09:07 +01:00
Dmitry Stogov
1c94ff0595 Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7

Pending changes regarding naming of BaseException and whether it
should be an interface.
2015-03-09 14:01:32 +01:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00