summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
committerOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
commit8f1428d29ef91d74b4d272af171675f2971eb15b (patch)
treea1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /ext/simplexml
parentc6e4182351e0173fe58de141e143aac2eacf5efe (diff)
downloadphp-upstream/5.3.9.tar.gz
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/php_simplexml.h4
-rwxr-xr-xext/simplexml/php_simplexml_exports.h4
-rw-r--r--ext/simplexml/simplexml.c11
-rwxr-xr-xext/simplexml/sxe.c4
-rwxr-xr-xext/simplexml/sxe.h4
-rw-r--r--ext/simplexml/tests/008.phpt9
-rw-r--r--ext/simplexml/tests/bug37076.phpt2
-rw-r--r--ext/simplexml/tests/bug37076_1.phpt2
-rw-r--r--ext/simplexml/tests/bug51615.phpt4
9 files changed, 29 insertions, 15 deletions
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h
index eee70138a..2c37eda8b 100644
--- a/ext/simplexml/php_simplexml.h
+++ b/ext/simplexml/php_simplexml.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_simplexml.h 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: php_simplexml.h 321634 2012-01-01 13:15:04Z felipe $ */
#ifndef PHP_SIMPLEXML_H
#define PHP_SIMPLEXML_H
diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h
index 313bb88eb..9c187ce66 100755
--- a/ext/simplexml/php_simplexml_exports.h
+++ b/ext/simplexml/php_simplexml_exports.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_simplexml_exports.h 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: php_simplexml_exports.h 321634 2012-01-01 13:15:04Z felipe $ */
#ifndef PHP_SIMPLEXML_EXPORTS_H
#define PHP_SIMPLEXML_EXPORTS_H
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 888a6c0fd..f9020026b 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c 314376 2011-08-06 14:47:44Z felipe $ */
+/* $Id: simplexml.c 321634 2012-01-01 13:15:04Z felipe $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1264,8 +1264,9 @@ SXE_METHOD(xpath)
result = retval->nodesetval;
+ array_init(return_value);
+
if (result != NULL) {
- array_init(return_value);
for (i = 0; i < result->nodeNr; ++i) {
nodeptr = result->nodeTab[i];
if (nodeptr->type == XML_TEXT_NODE || nodeptr->type == XML_ELEMENT_NODE || nodeptr->type == XML_ATTRIBUTE_NODE) {
@@ -1286,8 +1287,6 @@ SXE_METHOD(xpath)
add_next_index_zval(return_value, value);
}
}
- } else {
- RETVAL_FALSE;
}
xmlXPathFreeObject(retval);
@@ -2609,7 +2608,7 @@ PHP_MINFO_FUNCTION(simplexml)
{
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 314376 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 321634 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index 815bea1db..ff36e4aa6 100755
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sxe.c 312258 2011-06-18 15:56:14Z felipe $ */
+/* $Id: sxe.c 321634 2012-01-01 13:15:04Z felipe $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
diff --git a/ext/simplexml/sxe.h b/ext/simplexml/sxe.h
index c979d7ec0..65d119d80 100755
--- a/ext/simplexml/sxe.h
+++ b/ext/simplexml/sxe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sxe.h 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: sxe.h 321634 2012-01-01 13:15:04Z felipe $ */
#ifndef SXE_H
#define SXE_H
diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt
index 4fda204a2..8734ba4a4 100644
--- a/ext/simplexml/tests/008.phpt
+++ b/ext/simplexml/tests/008.phpt
@@ -25,7 +25,10 @@ EOF;
$sxe = simplexml_load_string($xml);
var_dump($sxe->xpath("elem1/elem2/elem3/elem4"));
+//valid expression
var_dump($sxe->xpath("***"));
+//invalid expression
+var_dump($sxe->xpath("**"));
?>
--EXPECTF--
array(1) {
@@ -36,4 +39,10 @@ array(1) {
}
}
}
+array(0) {
+}
+
+Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d
+
+Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in %s on line %d
bool(false)
diff --git a/ext/simplexml/tests/bug37076.phpt b/ext/simplexml/tests/bug37076.phpt
index a5b3801cc..c7f19b3cc 100644
--- a/ext/simplexml/tests/bug37076.phpt
+++ b/ext/simplexml/tests/bug37076.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37076 (SimpleXML ignores .=)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = simplexml_load_string("<root><foo /></root>");
diff --git a/ext/simplexml/tests/bug37076_1.phpt b/ext/simplexml/tests/bug37076_1.phpt
index d2260040c..d4f4e0333 100644
--- a/ext/simplexml/tests/bug37076_1.phpt
+++ b/ext/simplexml/tests/bug37076_1.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = simplexml_load_string("<root><foo /></root>");
diff --git a/ext/simplexml/tests/bug51615.phpt b/ext/simplexml/tests/bug51615.phpt
index 75f6769ff..94c7b20c4 100644
--- a/ext/simplexml/tests/bug51615.phpt
+++ b/ext/simplexml/tests/bug51615.phpt
@@ -1,7 +1,9 @@
--TEST--
Bug #51615 (PHP crash with wrong HTML in SimpleXML)
--SKIPIF--
-<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+<?php if (!extension_loaded("simplexml")) print "skip";
+ if (!extension_loaded("dom")) print "skip";
+?>
--FILE--
<?php