Commit Graph

185 Commits

Author SHA1 Message Date
Xinchen Hui
c87ef023aa Fixed Bug #70558 ("Couldn't fetch" error in DOMDocument::registerNodeClass()) 2015-09-23 07:01:50 -07: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
Christoph M. Becker
6576d809a5 test fails with old libxml2; skip in this case 2015-07-31 19:52:42 +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
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
Anatol Belski
9649cec2a3 added test for bug #69846 2015-06-19 12:46:19 +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
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
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
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
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
Rasmus Lerdorf
16d779a833 Adding a note here for my future self so I won't
need to look into this again
2015-01-09 16:36:21 -08:00
Tjerk Meesters
37a685ff2b More fixes for nodelist array access
- testing for null property read
- no zval copying if the type is already long
- memory fix for master
2014-10-12 12:47:58 +08:00
Tjerk Meesters
59f39dea66 Refactored DOMNodeList array dereferencing implementation 2014-10-09 23:07:12 +08:00
Florian MARGAINE
9469db9311 DOMNodeList elements are accessible through array notation
Fixes #67949
2014-09-27 01:27:46 +02:00
Tjerk Meesters
f54451cf39 Make DOMNode::textContent writeable 2014-09-02 06:34:18 +08:00
Matteo Beccati
af5057bea7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
2014-06-09 07:07:07 +02:00
Matteo Beccati
5c8c57aa6c Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
DOMDocument::substituteEntities needs to be set to true in order for
external entities to be parsed.
2014-06-09 07:05:23 +02:00
Anatol Belski
444690eca8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-16 14:14:52 +02:00
Anatol Belski
5224614f23 Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset 2014-04-16 14:13:45 +02:00
Michael Wallner
9c0a70c1de Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #65196
2013-12-02 17:01:25 +01:00
Michael Wallner
22fa3fbc5f Fix bug #65196
Passing DOMDocumentFragment to DOMDocument::saveHTML()
produces invalid markup, because a DocumentFragment is just a container
for child nodes and not a real node itself.
2013-12-02 17:00:13 +01:00
Antonio Diaz Ruiz
1a5c460ea2 Embeds the content of the DTD in the DOCTYPE declaration of the XML files. 2013-08-10 18:02:08 -07:00
Antonio Diaz Ruiz
5f5ff92bc0 Adds 2 new xml files which include the dtd path relative to the base directory for the php source code.
It fixs the fail on the load of the dtd in the tests modified by this commit.
2013-08-10 18:02:00 -07:00
Antonio Diaz Ruiz
24f36934ad Adds files: error 1 to 5 and variation 1 to 4
tests for error1: not well formed xml

tests for error2: not well formed xml attribute without colon

tests for error2: not well formed xml, typo

tests for error4: wrong xml version

tests for error5: extra content at the end of the doc

tests libxml_dtd_load

tests libxml_dtd_valid

tests for libdtd_noerror

tests for LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS

the basic behavior

fix comments
2013-08-10 18:01:54 -07:00
Stanislav Malyshev
473d66553d Merge branch 'pull-request/325' into PHP-5.5
* pull-request/325:
  Add schema default/fixed value support
2013-08-10 17:56:23 -07:00
Veres Lajos
8d86597d73 non living code related typo fixes 2013-08-04 16:05:36 -07:00
Veres Lajos
e9a95d78ef typo fixes 2013-07-15 00:23:03 -07:00
Stanislav Malyshev
ac40c0b562 Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:20:18 -07:00
Antonio Diaz Ruiz
8a8bef1b73 PHPTests for the DOMDocument::loadHTMLfile method.
They cover
- The basic behaviour
- When the method receives as argument a file which doesn't exist
- When the argument is an empty string
- When an empty file is loaded
- When a not-well formed html file is loaded

It also includes 2 auxilary files
- An empty html file
- A not well formed html file
2013-06-10 01:50:00 -07:00
Antonio Diaz Ruiz
92bbe6be72 Includes 5 new phpTests to check that the error message DOM_NOT_FOUND is properly raised by the method DOMNode::insertBefore(newNode, [refNode]).
Each file covers a different test case

    DOMNode_insertBefore_error2.phpt: refNode is a sibling of the node where newNode wanted to be inserted.
    DOMNode_insertBefore_error3.phpt: refNode is the parent of the node where newNode wanted to be inserted.
    DOMNode_insertBefore_error4.phpt: refNode is a brand new node.
    DOMNode_insertBefore_error5.phpt: refNode is a descendant (not child) of the node where newNode wanted to be inserted.
    DOMNode_insertBefore_error6.phpt: refNode is the node where newNode wanted to be inserted.
2013-04-21 11:05:59 +08:00
Chris Wright
c091819f40 Add schema default/fixed value support
Added support for adding fixed/default values during XSD validation
and added/updated associated tests
2013-04-12 09:50:14 +01:00
Xinchen Hui
e081c55fb5 Merge branch 'PHP-5.3' into PHP-5.4 2012-10-10 10:31:31 +08:00