summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2017-09-12 13:27:40 +0800
committerXinchen Hui <laruence@gmail.com>2017-09-12 13:27:40 +0800
commitafd59b0c80dafb11ba86be49f050212af9eb3962 (patch)
tree814d2802e4b9107e0455acd7d2b8cf68991ee421
parent58aa726548b18c4a48dd9804063b4eb8845aa7ef (diff)
parent87a91aef835c2c361e93b4352636f0dcb3275ac9 (diff)
downloadphp-git-afd59b0c80dafb11ba86be49f050212af9eb3962.tar.gz
Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src: Fixed bug #46781 (BC math handles minus zero incorrectly) Fork test to keep up with libxsl >= 1.1.30 Add symbol to libxml exports Fix test compat with libxml2 2.9.5 Fix test compat with libxml2 2.9.5 Fix test portability Fix test compatibility with libxml2 2.9.5
-rw-r--r--NEWS1
-rw-r--r--ext/bcmath/libbcmath/src/str2num.c3
-rw-r--r--ext/bcmath/tests/bug46781.phpt16
-rw-r--r--ext/dom/tests/dom005.phpt2
-rw-r--r--ext/libxml/php_libxml2.def1
-rw-r--r--ext/simplexml/tests/008.phpt4
-rw-r--r--ext/standard/tests/serialize/bug68044.phpt2
-rw-r--r--ext/standard/tests/serialize/bug74101.phpt2
-rw-r--r--ext/standard/tests/serialize/bug74614.phpt2
-rw-r--r--ext/xmlreader/tests/bug64230.phpt4
-rw-r--r--ext/xsl/tests/xslt010.phpt1
-rw-r--r--ext/xsl/tests/xslt010_gt10129.phpt206
12 files changed, 235 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index 59cb86524d..ddbc7e841a 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PHP NEWS
- BCMath:
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
+ . Fixed bug #46781 (BC math handles minus zero incorrectly). (cmb)
. Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1). (okano1220, cmb)
. Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus). (cmb)
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index ef505e86e1..62544de80e 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -105,5 +105,8 @@ bc_str2num (bc_num *num, char *str, int scale)
for (;strscale > 0; strscale--)
*nptr++ = CH_VAL(*ptr++);
}
+
+ if (bc_is_zero (*num))
+ (*num)->n_sign = PLUS;
}
diff --git a/ext/bcmath/tests/bug46781.phpt b/ext/bcmath/tests/bug46781.phpt
new file mode 100644
index 0000000000..caffe83860
--- /dev/null
+++ b/ext/bcmath/tests/bug46781.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #46781 (BC math handles minus zero incorrectly)
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
+?>
+--FILE--
+<?php
+var_dump(bcadd('-0.0', '-0.0', 1));
+var_dump(bccomp('-0.0', '0', 1));
+?>
+===DONE===
+--EXPECT--
+string(3) "0.0"
+int(0)
+===DONE===
diff --git a/ext/dom/tests/dom005.phpt b/ext/dom/tests/dom005.phpt
index 715aec4024..0aceb881bf 100644
--- a/ext/dom/tests/dom005.phpt
+++ b/ext/dom/tests/dom005.phpt
@@ -5,7 +5,7 @@ Test 5: HTML Test
--FILE--
<?php
$dom = new domdocument;
-$dom->loadHTMLFile(dirname(__FILE__)."/test.html");
+$dom->loadHTMLFile(dirname(__FILE__)."/test.html", LIBXML_NOBLANKS);
print "--- save as XML\n";
print adjustDoctype($dom->saveXML());
diff --git a/ext/libxml/php_libxml2.def b/ext/libxml/php_libxml2.def
index 905dbf386b..f4be787c8a 100644
--- a/ext/libxml/php_libxml2.def
+++ b/ext/libxml/php_libxml2.def
@@ -1546,3 +1546,4 @@ xmlXPtrRangeToFunction
xmlXPtrWrapLocationSet
xmlBufContent
xmlBufUse
+xmlBufferDetach
diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt
index 8734ba4a46..f6c41f43e5 100644
--- a/ext/simplexml/tests/008.phpt
+++ b/ext/simplexml/tests/008.phpt
@@ -42,7 +42,5 @@ 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
+Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d%A
bool(false)
diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt
index c074808d5a..01ada07ad8 100644
--- a/ext/standard/tests/serialize/bug68044.phpt
+++ b/ext/standard/tests/serialize/bug68044.phpt
@@ -6,7 +6,7 @@ Bug #68044 Integer overflow in unserialize() (32-bits only)
?>
===DONE==
--EXPECTF--
-Warning: unserialize(): Numerical result out of range in %sbug68044.php on line %d
+Warning: unserialize(): %s in %sbug68044.php on line %d
Warning: Insufficient data for unserializing - %d required, 1 present in %s%ebug68044.php on line 2
diff --git a/ext/standard/tests/serialize/bug74101.phpt b/ext/standard/tests/serialize/bug74101.phpt
index 27f7b947ff..323f6c6f46 100644
--- a/ext/standard/tests/serialize/bug74101.phpt
+++ b/ext/standard/tests/serialize/bug74101.phpt
@@ -6,7 +6,7 @@ $s = 'O:9:"Exception":799999999999999999999999999997:0i:0;a:0:{}i:2;i:0;i:0;R:2;
var_dump(unserialize($s));
?>
--EXPECTF--
-Warning: unserialize(): Numerical result out of range in %sbug74101.php on line %d
+Warning: unserialize(): %s in %sbug74101.php on line %d
Notice: unserialize(): Error at offset 48 of 74 bytes in %sbug74101.php on line %d
bool(false)
diff --git a/ext/standard/tests/serialize/bug74614.phpt b/ext/standard/tests/serialize/bug74614.phpt
index eab58d291b..efaaf885d2 100644
--- a/ext/standard/tests/serialize/bug74614.phpt
+++ b/ext/standard/tests/serialize/bug74614.phpt
@@ -7,6 +7,6 @@ unserialize('a:3020000000000000000000000000000001:{i:0;a:0:{}i:1;i:2;i:2;i:3;i:3
?>
--EXPECTF--
-Warning: unserialize(): Numerical result out of range in %sbug74614.php on line %d
+Warning: unserialize(): %s in %sbug74614.php on line %d
Notice: unserialize(): Error at offset %d of 113 bytes in %s on line %d
diff --git a/ext/xmlreader/tests/bug64230.phpt b/ext/xmlreader/tests/bug64230.phpt
index 0b070925f3..fb1ab4932f 100644
--- a/ext/xmlreader/tests/bug64230.phpt
+++ b/ext/xmlreader/tests/bug64230.phpt
@@ -38,11 +38,11 @@ Done
--EXPECTF--
Test
Internal errors TRUE
-Internal: Specification mandate value for attribute att
+Internal: Specification mandate%A value for attribute att
Internal errors FALSE
-Warning: XMLReader::read(): %s: parser error : Specification mandate value for attribute att in %s on line %d
+Warning: XMLReader::read(): %s: parser error : Specification mandate%A value for attribute att in %s on line %d
Warning: XMLReader::read(): <root att/> in %s on line %d
diff --git a/ext/xsl/tests/xslt010.phpt b/ext/xsl/tests/xslt010.phpt
index 96ef8c6275..adabbf55a0 100644
--- a/ext/xsl/tests/xslt010.phpt
+++ b/ext/xsl/tests/xslt010.phpt
@@ -6,6 +6,7 @@ require_once dirname(__FILE__) .'/skipif.inc';
$proc = new xsltprocessor;
if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');
if (LIBXSLT_VERSION < 10117) die('skip too old libxsl');
+if (LIBXSLT_VERSION > 10129) die('skip for libxsl < 10130');
?>
--FILE--
<?php
diff --git a/ext/xsl/tests/xslt010_gt10129.phpt b/ext/xsl/tests/xslt010_gt10129.phpt
new file mode 100644
index 0000000000..68ea6218db
--- /dev/null
+++ b/ext/xsl/tests/xslt010_gt10129.phpt
@@ -0,0 +1,206 @@
+--TEST--
+Test 10: EXSLT Support
+--SKIPIF--
+<?php
+require_once dirname(__FILE__) .'/skipif.inc';
+$proc = new xsltprocessor;
+if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');
+if (LIBXSLT_VERSION < 10130) die('skip too old libxsl');
+?>
+--FILE--
+<?php
+echo "Test 10: EXSLT Support";
+
+$dom = new domDocument();
+ $dom->load(dirname(__FILE__)."/exslt.xsl");
+ $proc = new xsltprocessor;
+ $xsl = $proc->importStylesheet($dom);
+
+ $xml = new DomDocument();
+ $xml->load(dirname(__FILE__)."/exslt.xml");
+
+ print $proc->transformToXml($xml);
+--EXPECT--
+Test 10: EXSLT Support
+
+
+ Test Date : 0001-12-31Z
+ year : 1
+ leap-year : false
+ month-in-year : 12
+ month-name : December
+ month-abbreviation : Dec
+ week-in-year : 1
+ day-in-year : 365
+ day-in-month : 31
+ day-of-week-in-month : 5
+ day-in-week : 2
+ day-name : Monday
+ day-abbreviation : Mon
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 3000-01-31
+ year : 3000
+ leap-year : false
+ month-in-year : 1
+ month-name : January
+ month-abbreviation : Jan
+ week-in-year : 5
+ day-in-year : 31
+ day-in-month : 31
+ day-of-week-in-month : 5
+ day-in-week : 6
+ day-name : Friday
+ day-abbreviation : Fri
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 2000-02-29
+ year : 2000
+ leap-year : true
+ month-in-year : 2
+ month-name : February
+ month-abbreviation : Feb
+ week-in-year : 9
+ day-in-year : 60
+ day-in-month : 29
+ day-of-week-in-month : 5
+ day-in-week : 3
+ day-name : Tuesday
+ day-abbreviation : Tue
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 9990001-12-31Z
+ year : 9990001
+ leap-year : false
+ month-in-year : 12
+ month-name : December
+ month-abbreviation : Dec
+ week-in-year : 1
+ day-in-year : 365
+ day-in-month : 31
+ day-of-week-in-month : 5
+ day-in-week : 2
+ day-name : Monday
+ day-abbreviation : Mon
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : -0004-02-29
+ year : NaN
+ leap-year : NaN
+ month-in-year : NaN
+ month-name :
+ month-abbreviation :
+ week-in-year : NaN
+ day-in-year : NaN
+ day-in-month : NaN
+ day-of-week-in-month : NaN
+ day-in-week : NaN
+ day-name :
+ day-abbreviation :
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 1999-01-02
+ year : 1999
+ leap-year : false
+ month-in-year : 1
+ month-name : January
+ month-abbreviation : Jan
+ week-in-year : 53
+ day-in-year : 2
+ day-in-month : 2
+ day-of-week-in-month : 1
+ day-in-week : 7
+ day-name : Saturday
+ day-abbreviation : Sat
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 1999-01-03
+ year : 1999
+ leap-year : false
+ month-in-year : 1
+ month-name : January
+ month-abbreviation : Jan
+ week-in-year : 53
+ day-in-year : 3
+ day-in-month : 3
+ day-of-week-in-month : 1
+ day-in-week : 1
+ day-name : Sunday
+ day-abbreviation : Sun
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 2004-01-01
+ year : 2004
+ leap-year : true
+ month-in-year : 1
+ month-name : January
+ month-abbreviation : Jan
+ week-in-year : 1
+ day-in-year : 1
+ day-in-month : 1
+ day-of-week-in-month : 1
+ day-in-week : 5
+ day-name : Thursday
+ day-abbreviation : Thu
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 2006-01-01
+ year : 2006
+ leap-year : false
+ month-in-year : 1
+ month-name : January
+ month-abbreviation : Jan
+ week-in-year : 52
+ day-in-year : 1
+ day-in-month : 1
+ day-of-week-in-month : 1
+ day-in-week : 1
+ day-name : Sunday
+ day-abbreviation : Sun
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+
+ Test Date : 2007-12-31
+ year : 2007
+ leap-year : false
+ month-in-year : 12
+ month-name : December
+ month-abbreviation : Dec
+ week-in-year : 1
+ day-in-year : 365
+ day-in-month : 31
+ day-of-week-in-month : 5
+ day-in-week : 2
+ day-name : Monday
+ day-abbreviation : Mon
+ time :
+ hour-in-day : NaN
+ minute-in-hour : NaN
+ second-in-minute : NaN
+