diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
| commit | 0a36161e13484a99ccf69bb38f206462d27cc6d6 (patch) | |
| tree | d5107db4b7369603ac7c753829e8972ee74949f7 /ext/xml | |
| parent | ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (diff) | |
| download | php-upstream/5.1.2.tar.gz | |
Imported Upstream version 5.1.2upstream/5.1.2
Diffstat (limited to 'ext/xml')
| -rw-r--r-- | ext/xml/compat.c | 13 | ||||
| -rw-r--r-- | ext/xml/config.m4 | 4 | ||||
| -rw-r--r-- | ext/xml/expat_compat.h | 8 | ||||
| -rw-r--r-- | ext/xml/php_xml.h | 10 | ||||
| -rw-r--r-- | ext/xml/tests/bug25666.phpt | 3 | ||||
| -rw-r--r-- | ext/xml/tests/bug26528.phpt | 4 | ||||
| -rw-r--r-- | ext/xml/tests/bug26614.phpt | 5 | ||||
| -rwxr-xr-x | ext/xml/tests/bug26614_libxml.phpt | 5 | ||||
| -rw-r--r-- | ext/xml/tests/bug27908.phpt | 4 | ||||
| -rw-r--r-- | ext/xml/tests/bug30266.phpt | 4 | ||||
| -rw-r--r-- | ext/xml/tests/bug32001.phpt | 85 | ||||
| -rwxr-xr-x | ext/xml/tests/bug32001b.phpt | 184 | ||||
| -rw-r--r-- | ext/xml/tests/bug35447.phpt | 49 | ||||
| -rw-r--r-- | ext/xml/tests/xml001.phpt | 16 | ||||
| -rw-r--r-- | ext/xml/tests/xml002.phpt | 16 | ||||
| -rw-r--r-- | ext/xml/tests/xml003.phpt | 16 | ||||
| -rw-r--r-- | ext/xml/tests/xml009.phpt | 1 | ||||
| -rw-r--r-- | ext/xml/tests/xml010.phpt | 1 | ||||
| -rw-r--r-- | ext/xml/xml.c | 10 |
19 files changed, 305 insertions, 133 deletions
diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 43e116b86..cfa56e1b5 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -2,12 +2,12 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | + | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | + | 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 | | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | @@ -405,15 +405,12 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m efree(parser); return NULL; } - if (encoding != NULL) { - parser->parser->encoding = xmlStrdup(encoding); #if LIBXML_VERSION <= 20617 /* for older versions of libxml2, allow correct detection of * charset in documents with a BOM: */ - } else { - parser->parser->charset = XML_CHAR_ENCODING_NONE; + parser->parser->charset = XML_CHAR_ENCODING_NONE; #endif - } + parser->parser->replaceEntities = 1; parser->parser->wellFormed = 0; if (sep != NULL) { diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 index 2afcd7dc9..e5fa565ab 100644 --- a/ext/xml/config.m4 +++ b/ext/xml/config.m4 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.54 2005/06/20 00:52:59 sniper Exp $ +dnl $Id: config.m4,v 1.54.2.1 2005/12/22 08:57:38 helly Exp $ dnl PHP_ARG_ENABLE(xml,whether to enable XML support, @@ -36,7 +36,7 @@ if test "$PHP_XML" != "no"; then dnl Check for expat only if --with-libexpat-dir is used. dnl if test "$PHP_LIBEXPAT_DIR" != "no"; then - for i in $PHP_XML $PHP_LIBEXPAT_DIR; do + for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then EXPAT_DIR=$i break diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index 2c1ec1e87..3663e3fdf 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -2,12 +2,12 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | + | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | + | 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 | | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: expat_compat.h,v 1.19 2005/08/03 14:08:21 sniper Exp $ */ +/* $Id: expat_compat.h,v 1.19.2.1 2006/01/01 12:50:16 sniper Exp $ */ #ifndef PHP_EXPAT_COMPAT_H #define PHP_EXPAT_COMPAT_H diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h index 773b8698b..cb6dc0735 100644 --- a/ext/xml/php_xml.h +++ b/ext/xml/php_xml.h @@ -2,12 +2,12 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | + | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | + | 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 | | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_xml.h,v 1.28 2005/08/03 14:08:21 sniper Exp $ */ +/* $Id: php_xml.h,v 1.28.2.2 2006/01/01 12:50:16 sniper Exp $ */ #ifndef PHP_XML_H #define PHP_XML_H @@ -86,7 +86,7 @@ typedef struct { int level; int toffset; int curtag; - pval **ctag; + zval **ctag; char **ltags; int lastwasopen; int skipwhite; diff --git a/ext/xml/tests/bug25666.phpt b/ext/xml/tests/bug25666.phpt index ce67ea8ed..e162d5a2b 100644 --- a/ext/xml/tests/bug25666.phpt +++ b/ext/xml/tests/bug25666.phpt @@ -2,7 +2,8 @@ Bug #25666 (XML namespaces broken in libxml-based SAX interface) --SKIPIF-- <?php -if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this plattform");} +require_once("skipif.inc"); +if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this platform");} ?> --FILE-- <?php diff --git a/ext/xml/tests/bug26528.phpt b/ext/xml/tests/bug26528.phpt index 2fa015a84..40a1c53c9 100644 --- a/ext/xml/tests/bug26528.phpt +++ b/ext/xml/tests/bug26528.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #26528 (HTML entities are not being decoded) +--SKIPIF-- +<?php +require_once("skipif.inc"); +?> --FILE-- <?php $sample = "<?xml version=\"1.0\"?><test attr=\"angle<bracket\"/>"; diff --git a/ext/xml/tests/bug26614.phpt b/ext/xml/tests/bug26614.phpt index a8a91ae87..e1df1bbfd 100644 --- a/ext/xml/tests/bug26614.phpt +++ b/ext/xml/tests/bug26614.phpt @@ -1,7 +1,10 @@ --TEST-- Bug #26614 (CDATA sections skipped on line count) --SKIPIF-- -<?php if (defined("LIBXML_VERSION")) die('skip expat test'); ?> +<?php +require_once("skipif.inc"); +if (defined("LIBXML_VERSION")) die('skip expat test'); +?> --FILE-- <?php /* diff --git a/ext/xml/tests/bug26614_libxml.phpt b/ext/xml/tests/bug26614_libxml.phpt index 645bf7e75..782bdb193 100755 --- a/ext/xml/tests/bug26614_libxml.phpt +++ b/ext/xml/tests/bug26614_libxml.phpt @@ -1,7 +1,10 @@ --TEST-- Bug #26614 (CDATA sections skipped on line count) --SKIPIF-- -<?php if (!defined("LIBXML_VERSION")) die('skip libxml2 test'); ?> +<?php +require_once("skipif.inc"); +if (!defined("LIBXML_VERSION")) die('skip libxml2 test'); +?> --FILE-- <?php /* diff --git a/ext/xml/tests/bug27908.phpt b/ext/xml/tests/bug27908.phpt index abb856137..e60466fa1 100644 --- a/ext/xml/tests/bug27908.phpt +++ b/ext/xml/tests/bug27908.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #27908 (default handler not being called) +--SKIPIF-- +<?php +require_once("skipif.inc"); +?> --FILE-- <?php diff --git a/ext/xml/tests/bug30266.phpt b/ext/xml/tests/bug30266.phpt index ebc0a270c..0a3a5ca46 100644 --- a/ext/xml/tests/bug30266.phpt +++ b/ext/xml/tests/bug30266.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #30266 (Invalid opcode 137/1/8) +--SKIPIF-- +<?php +require_once("skipif.inc"); +?> --FILE-- <?php /* diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt index 22f405ae5..e9780016c 100644 --- a/ext/xml/tests/bug32001.phpt +++ b/ext/xml/tests/bug32001.phpt @@ -1,10 +1,9 @@ --TEST-- -Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect) +Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* --SKIPIF-- <?php - if (!extension_loaded('iconv')) { - die ("skip iconv extension not available\n"); - } +require_once("skipif.inc"); +if (!extension_loaded('iconv')) die ("skip iconv extension not available"); ?> --FILE-- <?php @@ -149,12 +148,6 @@ $suite = array( new testcase("UTF-16LE", 1, 0, 0), new testcase("UTF-16LE", 1, 1, 0), new testcase("UTF-16LE", 1, 1, 1), - new testcase("EUC-JP" , 0), - new testcase("EUC-JP" , 1), - new testcase("Shift_JIS", 0), - new testcase("Shift_JIS", 1), - new testcase("GB2312", 0), - new testcase("GB2312", 1), ); if (XML_SAX_IMPL == 'libxml') { @@ -413,75 +406,3 @@ array(3) { [2]=> string(42) "e38386e382b9e383883ae38386e382b9e3838833: " } -Encoding: EUC-JP -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: EUC-JP -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} diff --git a/ext/xml/tests/bug32001b.phpt b/ext/xml/tests/bug32001b.phpt new file mode 100755 index 000000000..f4aea08e5 --- /dev/null +++ b/ext/xml/tests/bug32001b.phpt @@ -0,0 +1,184 @@ +--TEST-- +Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using EUC-JP, Shift_JIS, GB2312 +--SKIPIF-- +<?php +require_once("skipif.inc"); +if (!extension_loaded('iconv')) die ("skip iconv extension not available"); +foreach(array('EUC-JP', 'Shift_JISP', 'GB2312') as $encoding) { + if (@xml_parser_create($encoding) === false) die("skip libxml2 does not support $encoding encoding"); +} +?> +--FILE-- +<?php +class testcase { + private $encoding; + private $bom; + private $prologue; + private $tags; + private $chunk_size; + + function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { + $this->encoding = $enc; + $this->chunk_size = $chunk_size; + $this->bom = $bom; + $this->prologue = !$omit_prologue; + $this->tags = array(); + } + + function start_element($parser, $name, $attrs) { + $attrs = array_map('bin2hex', $attrs); + $this->tags[] = bin2hex($name).": ".implode(', ', $attrs); + } + + function end_element($parser, $name) { + } + + function run() { + $data = ''; + + if ($this->prologue) { + $canonical_name = preg_replace('/BE|LE/i', '', $this->encoding); + $data .= "<?xml version=\"1.0\" encoding=\"$canonical_name\" ?>\n"; + } + + $data .= <<<HERE +<テスト:テスト1 xmlns:テスト="http://www.example.com/テスト/" テスト="テスト"> + <テスト:テスト2 テスト="テスト"> + <テスト:テスト3> + test! + </テスト:テスト3> + </テスト:テスト2> +</テスト:テスト1> +HERE; + + $data = iconv("UTF-8", $this->encoding, $data); + + $parser = xml_parser_create(NULL); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_set_element_handler($parser, "start_element", "end_element"); + xml_set_object($parser, $this); + + if ($this->chunk_size == 0) { + $success = @xml_parse($parser, $data, true); + } else { + for ($offset = 0; $offset < strlen($data); + $offset += $this->chunk_size) { + $success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false); + if (!$success) { + break; + } + } + if ($success) { + $success = @xml_parse($parser, "", true); + } + } + + echo "Encoding: $this->encoding\n"; + echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n"; + echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n"); + echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n"; + + if ($success) { + var_dump($this->tags); + } else { + echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n"; + } + } +} +$suite = array( + new testcase("EUC-JP" , 0), + new testcase("EUC-JP" , 1), + new testcase("Shift_JIS", 0), + new testcase("Shift_JIS", 1), + new testcase("GB2312", 0), + new testcase("GB2312", 1), +); + +if (XML_SAX_IMPL == 'libxml') { + $php = getenv('TEST_PHP_EXECUTABLE'); + preg_match("/^libxml2 Version.*\$/im", `$php -i`, $match); + echo $match[0], "\n"; +} else { + echo "libxml2 Version => NONE\n"; +} + +foreach ($suite as $testcase) { + $testcase->run(); +} + +// vim600: sts=4 sw=4 ts=4 encoding=UTF-8 +?> +--EXPECTF-- +libxml2 Version => %s +Encoding: EUC-JP +XML Prologue: present +Chunk size: all data at once +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} +Encoding: EUC-JP +XML Prologue: present +Chunk size: 1 byte(s) +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} +Encoding: Shift_JIS +XML Prologue: present +Chunk size: all data at once +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} +Encoding: Shift_JIS +XML Prologue: present +Chunk size: 1 byte(s) +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} +Encoding: GB2312 +XML Prologue: present +Chunk size: all data at once +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} +Encoding: GB2312 +XML Prologue: present +Chunk size: 1 byte(s) +BOM: not prepended +array(3) { + [0]=> + string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" + [1]=> + string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" + [2]=> + string(42) "e38386e382b9e383883ae38386e382b9e3838833: " +} diff --git a/ext/xml/tests/bug35447.phpt b/ext/xml/tests/bug35447.phpt new file mode 100644 index 000000000..8cbb5e519 --- /dev/null +++ b/ext/xml/tests/bug35447.phpt @@ -0,0 +1,49 @@ +--TEST-- +Bug #35447 (xml_parse_into_struct() chokes on the UTF-8 BOM) +--SKIPIF-- +<?php +require_once("skipif.inc"); +if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this plattform");} +?> +--FILE-- +<?php +$data = <<<END_OF_XML +\xEF\xBB\xBF<?xml version="1.0" encoding="utf-8"?\x3e +<!DOCTYPE bundle [ + <!ELEMENT bundle (resource)+> + <!ELEMENT resource (#PCDATA)> + <!ATTLIST resource + key CDATA #REQUIRED + type (literal|pattern|sub) "literal" + > +]> +<resource key="rSeeYou">A bient&244;t</resource> +END_OF_XML; + +$parser = xml_parser_create_ns('UTF-8'); +xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); +$result = xml_parse_into_struct($parser, $data, $vals, $index); +xml_parser_free($parser); +var_dump($vals); +?> +--EXPECT-- +array(1) { + [0]=> + array(5) { + ["tag"]=> + string(8) "resource" + ["type"]=> + string(8) "complete" + ["level"]=> + int(1) + ["attributes"]=> + array(2) { + ["key"]=> + string(7) "rSeeYou" + ["type"]=> + string(7) "literal" + } + ["value"]=> + string(13) "A bient&244;t" + } +} diff --git a/ext/xml/tests/xml001.phpt b/ext/xml/tests/xml001.phpt index 6ee908e46..62d597c5f 100644 --- a/ext/xml/tests/xml001.phpt +++ b/ext/xml/tests/xml001.phpt @@ -35,42 +35,42 @@ xml_parser_free($xml_parser); function startElement($parser, $name, $attribs) { - print "\{$name"; + print '{'.$name; if (sizeof($attribs)) { while (list($k, $v) = each($attribs)) { print " $k=\"$v\""; } } - print "}"; + print '}'; } function endElement($parser, $name) { - print "\{/$name}"; + print '{/'.$name.'}'; } function characterData($parser, $data) { - print "\{CDATA[$data]}"; + print '{CDATA['.$data.']}'; } function PIHandler($parser, $target, $data) { - print "\{PI[$target,$data]}"; + print '{PI['.$target.','.$data.']}'; } function defaultHandler($parser, $data) { if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { - print "\{ENTREF[$data]}"; + print '{ENTREF['.$data.']}'; } else { - print "\{?[$data]}"; + print '{?['.$data.']}'; } } function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId) { - print "\{EXTENTREF[$openEntityNames,$base,$systemId,$publicId]}\n"; + print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n"; return true; } diff --git a/ext/xml/tests/xml002.phpt b/ext/xml/tests/xml002.phpt index 978500292..8ae8dfbe6 100644 --- a/ext/xml/tests/xml002.phpt +++ b/ext/xml/tests/xml002.phpt @@ -15,37 +15,37 @@ class myclass { function startElement($parser, $name, $attribs) { - print "\{$name"; + print '{'.$name; if (sizeof($attribs)) { while (list($k, $v) = each($attribs)) { print " $k=\"$v\""; } } - print "}"; + print '}'; } function endElement($parser, $name) { - print "\{/$name}"; + print '{/'.$name.'}'; } function characterData($parser, $data) { - print "\{CDATA[$data]}"; + print '{CDATA['.$data.']}'; } function PIHandler($parser, $target, $data) { - print "\{PI[$target,$data]}"; + print '{PI['.$target.','.$data.']}'; } function defaultHandler($parser, $data) { if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { - print "\{ENTREF[$data]}"; + print '{ENTREF['.$data.']}'; } else { - print "\{?[$data]}"; + print '{?['.$data.']}'; } } function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId) { - print "\{EXTENTREF[$openEntityNames,$base,$systemId,$publicId]}\n"; + print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n"; return true; } } diff --git a/ext/xml/tests/xml003.phpt b/ext/xml/tests/xml003.phpt index fa0984e89..311c81acf 100644 --- a/ext/xml/tests/xml003.phpt +++ b/ext/xml/tests/xml003.phpt @@ -15,37 +15,37 @@ class myclass { function startElement($parser, $name, $attribs) { - print "\{$name"; + print '{'.$name; if (sizeof($attribs)) { while (list($k, $v) = each($attribs)) { print " $k=\"$v\""; } } - print "}"; + print '}'; } function endElement($parser, $name) { - print "\{/$name}"; + print '{/'.$name.'}'; } function characterData($parser, $data) { - print "\{CDATA[$data]}"; + print '{CDATA['.$data.']}'; } function PIHandler($parser, $target, $data) { - print "\{PI[$target,$data]}"; + print '{PI['.$target.','.$data.']}'; } function defaultHandler($parser, $data) { if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { - print "\{ENTREF[$data]}"; + print '{ENTREF['.$data.']}'; } else { - print "\{?[$data]}"; + print '{?['.$data.']}'; } } function externalEntityRefHandler($parser, $openEntityNames, $base, $systemId, $publicId) { - print "\{EXTENTREF[$openEntityNames,$base,$systemId,$publicId]}\n"; + print '{EXTENTREF['.$openEntityNames.','.$base.','.$systemId.','.$publicId."]}\n"; return true; } } diff --git a/ext/xml/tests/xml009.phpt b/ext/xml/tests/xml009.phpt index 3b64e7b8b..84b89bb48 100644 --- a/ext/xml/tests/xml009.phpt +++ b/ext/xml/tests/xml009.phpt @@ -2,6 +2,7 @@ XML parser test, default namespaces --SKIPIF-- <?php +require_once("skipif.inc"); if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this plattform");} ?> --FILE-- diff --git a/ext/xml/tests/xml010.phpt b/ext/xml/tests/xml010.phpt index 125e9c7b0..e96844212 100644 --- a/ext/xml/tests/xml010.phpt +++ b/ext/xml/tests/xml010.phpt @@ -2,6 +2,7 @@ XML parser test, attributes --SKIPIF-- <?php +require_once("skipif.inc"); if (! @xml_parser_create_ns('ISO-8859-1')) { die("skip xml_parser_create_ns is not supported on this plattform");} ?> --FILE-- diff --git a/ext/xml/xml.c b/ext/xml/xml.c index d40b2810b..e96daf640 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -2,12 +2,12 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | + | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | + | 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 | | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xml.c,v 1.157.2.1 2005/10/12 03:21:05 rrichards Exp $ */ +/* $Id: xml.c,v 1.157.2.3 2006/01/01 12:50:16 sniper Exp $ */ #define IS_EXT_MODULE @@ -111,7 +111,7 @@ static ZEND_ARG_PASS_INFO(1) ZEND_END_ARG_INFO(); -function_entry xml_functions[] = { +zend_function_entry xml_functions[] = { PHP_FE(xml_parser_create, NULL) PHP_FE(xml_parser_create_ns, NULL) PHP_FE(xml_set_object, second_arg_force_ref) |
