summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/curl/interface.c16
-rw-r--r--ext/curl/multi.c3
-rw-r--r--ext/curl/streams.c4
-rw-r--r--ext/curl/tests/bug62839.phpt2
-rw-r--r--ext/date/lib/astro.c2
-rw-r--r--ext/date/lib/dow.c2
-rw-r--r--ext/date/lib/interval.c2
-rw-r--r--ext/date/lib/parse_date.c102
-rw-r--r--ext/date/lib/parse_date.re4
-rw-r--r--ext/date/lib/parse_iso_intervals.c2
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/parse_tz.c2
-rw-r--r--ext/date/lib/timelib.c2
-rw-r--r--ext/date/lib/timelib.h2
-rw-r--r--ext/date/lib/timelib_structs.h2
-rw-r--r--ext/date/lib/tm2unixtime.c2
-rw-r--r--ext/date/lib/unixtime2tm.c2
-rw-r--r--ext/date/php_date.c16
-rw-r--r--ext/date/tests/bug62561.phpt16
-rw-r--r--ext/date/tests/bug62852.phpt33
-rw-r--r--ext/date/tests/bug62896.phpt40
-rw-r--r--ext/dba/libcdb/cdb.c2
-rw-r--r--ext/dba/libcdb/cdb.h2
-rw-r--r--ext/dba/libcdb/cdb_make.c2
-rw-r--r--ext/dba/libcdb/cdb_make.h2
-rw-r--r--ext/dba/libcdb/uint32.c2
-rw-r--r--ext/dba/libcdb/uint32.h2
-rw-r--r--ext/dba/libflatfile/flatfile.c2
-rw-r--r--ext/dba/libflatfile/flatfile.h2
-rw-r--r--ext/dba/libinifile/inifile.c2
-rw-r--r--ext/dba/libinifile/inifile.h2
-rw-r--r--ext/dom/domerrorhandler.c2
-rw-r--r--ext/fileinfo/libmagic.patch305
-rw-r--r--ext/fileinfo/libmagic/apprentice.c8
-rw-r--r--ext/filter/filter_private.h6
-rw-r--r--ext/filter/logical_filters.c7
-rw-r--r--ext/filter/tests/bug49510.phpt36
-rw-r--r--ext/gd/libgd/xbm.c2
-rw-r--r--ext/intl/common/common_error.c2
-rw-r--r--ext/intl/dateformat/dateformat_class.c2
-rw-r--r--ext/intl/formatter/formatter_class.c2
-rw-r--r--ext/intl/msgformat/msgformat_class.c2
-rw-r--r--ext/intl/php_intl.c4
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c2
-rw-r--r--ext/intl/tests/bug62915-2.phpt33
-rw-r--r--ext/intl/transliterator/transliterator_class.c2
-rw-r--r--ext/mbstring/mbstring.c16
-rw-r--r--ext/mbstring/tests/mb_str_functions_opt-parameter.phpt2
-rw-r--r--ext/oci8/config.m48
-rw-r--r--ext/oci8/package.xml29
-rw-r--r--ext/openssl/openssl.c32
-rw-r--r--ext/pcre/php_pcre.c32
-rw-r--r--ext/pcre/tests/null_bytes.phpt42
-rw-r--r--ext/soap/php_encoding.c7
-rw-r--r--ext/soap/tests/bugs/bug50997.phpt16
-rw-r--r--ext/soap/tests/bugs/bug50997.wsdl54
-rw-r--r--ext/sockets/multicast.h5
-rw-r--r--ext/sockets/tests/bug63000.phpt22
-rwxr-xr-xext/spl/spl_array.c80
-rwxr-xr-xext/spl/spl_iterators.c2
-rw-r--r--ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt50
-rw-r--r--ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt56
-rw-r--r--ext/spl/tests/arrayObject___construct_basic2.phpt4
-rw-r--r--ext/spl/tests/arrayObject___construct_basic3.phpt4
-rw-r--r--ext/spl/tests/arrayObject___construct_basic4.phpt10
-rw-r--r--ext/spl/tests/arrayObject___construct_basic5.phpt10
-rw-r--r--ext/spl/tests/arrayObject_magicMethods1.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods3.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods4.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods6.phpt4
-rw-r--r--ext/spl/tests/arrayObject_setFlags_basic1.phpt4
-rwxr-xr-xext/spl/tests/array_001.phpt8
-rwxr-xr-xext/spl/tests/array_010.phpt8
-rw-r--r--ext/spl/tests/bug45622.phpt2
-rw-r--r--ext/spl/tests/bug45622b.phpt4
-rw-r--r--ext/spl/tests/bug54323.phpt2
-rw-r--r--ext/spl/tests/bug62978.phpt50
-rwxr-xr-xext/spl/tests/iterator_044.phpt16
-rw-r--r--ext/standard/assert.c48
-rw-r--r--ext/standard/tests/assert/assert04.phpt5
-rw-r--r--ext/standard/tests/assert/assert_basic6.phpt26
-rw-r--r--ext/standard/tests/assert/assert_error1.phpt11
-rw-r--r--ext/standard/tests/assert/assert_error2.phpt30
-rw-r--r--ext/standard/tests/assert/assert_error3.phpt21
-rw-r--r--ext/standard/tests/assert/assert_error4.phpt21
-rw-r--r--ext/standard/tests/general_functions/bug60723.phpt19
-rw-r--r--ext/standard/tests/network/gethostbyname_basic001.phpt1
-rw-r--r--ext/standard/tests/network/gethostbyname_basic002.phpt15
-rw-r--r--ext/standard/tests/network/gethostbyname_error004.phpt1
-rw-r--r--ext/standard/tests/network/getmxrr.phpt1
-rw-r--r--ext/standard/tests/serialize/bug35895.phpt24
-rw-r--r--ext/standard/tests/strings/http_build_query_error.phpt13
-rw-r--r--ext/standard/tests/url/bug63162.phpt38
-rw-r--r--ext/standard/url.c2
-rw-r--r--ext/standard/url_scanner_ex.c4
-rw-r--r--ext/standard/url_scanner_ex.re4
-rw-r--r--ext/standard/var.c8
-rw-r--r--ext/zlib/tests/bug55544-win.phptbin0 -> 427 bytes
-rw-r--r--ext/zlib/tests/bug55544.phptbin361 -> 430 bytes
-rw-r--r--ext/zlib/tests/bug_52944-darwin.phpt24
-rw-r--r--ext/zlib/tests/bug_52944-win.phpt24
-rw-r--r--ext/zlib/tests/bug_52944.phpt189
-rw-r--r--ext/zlib/tests/bug_52944_corrupted_data.inc142
103 files changed, 1272 insertions, 683 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index b57ce1bd07..d75e5c058b 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -713,6 +713,14 @@ PHP_MINIT_FUNCTION(curl)
#if LIBCURL_VERSION_NUM >= 0x071202
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
+ REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
+ REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
+ REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
+ REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
+#endif
/* cURL protocol constants (curl_version) */
@@ -2447,6 +2455,8 @@ PHP_FUNCTION(curl_getinfo)
create_certinfo(ci, listcode TSRMLS_CC);
CAAZ("certinfo", listcode);
}
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) {
CAAS("primary_ip", s_code);
}
@@ -2473,10 +2483,10 @@ PHP_FUNCTION(curl_getinfo)
} else {
switch (option) {
/* string variable types */
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
case CURLINFO_PRIMARY_IP:
#endif
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
case CURLINFO_LOCAL_IP:
#endif
case CURLINFO_PRIVATE:
@@ -2496,7 +2506,7 @@ PHP_FUNCTION(curl_getinfo)
break;
}
/* Long variable types */
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
case CURLINFO_PRIMARY_PORT:
case CURLINFO_LOCAL_PORT:
#endif
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 034aa65c28..53e97b80f8 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -191,6 +191,9 @@ PHP_FUNCTION(curl_multi_select)
FD_ZERO(&exceptfds);
curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd);
+ if (maxfd == -1) {
+ RETURN_LONG(-1);
+ }
RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to));
}
/* }}} */
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 19328d886c..821c2ecad8 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
}
do {
+ FD_ZERO(&curlstream->readfds);
+ FD_ZERO(&curlstream->writefds);
+ FD_ZERO(&curlstream->excfds);
+
/* get the descriptors from curl */
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
diff --git a/ext/curl/tests/bug62839.phpt b/ext/curl/tests/bug62839.phpt
index 39e6fc9cbe..e6988d6de1 100644
--- a/ext/curl/tests/bug62839.phpt
+++ b/ext/curl/tests/bug62839.phpt
@@ -7,7 +7,7 @@ Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE)
<?php
$curl = curl_init();
-$fd = fopen('/tmp/test', 'wb');
+$fd = tmpfile();
curl_setopt($curl, CURLOPT_FILE, $fd);
curl_copy_handle($curl);
diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c
index 0438f98904..064700f912 100644
--- a/ext/date/lib/astro.c
+++ b/ext/date/lib/astro.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index b33e8eab72..9cb9c9cd28 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c
index af150fc802..451b463191 100644
--- a/ext/date/lib/interval.c
+++ b/ext/date/lib/interval.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index fbe330700b..4829da6c91 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */
+/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
@@ -995,7 +995,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
-#line 1082 "ext/date/lib/parse_date.re"
+#line 1083 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -1034,7 +1034,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
-#line 1676 "ext/date/lib/parse_date.re"
+#line 1677 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1358,7 +1358,7 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
-#line 1771 "ext/date/lib/parse_date.re"
+#line 1772 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
@@ -2420,7 +2420,7 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
-#line 1760 "ext/date/lib/parse_date.re"
+#line 1761 "ext/date/lib/parse_date.re"
{
goto std;
}
@@ -2433,7 +2433,7 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
-#line 1765 "ext/date/lib/parse_date.re"
+#line 1766 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
@@ -2825,7 +2825,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
-#line 1744 "ext/date/lib/parse_date.re"
+#line 1745 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -3602,7 +3602,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
-#line 1607 "ext/date/lib/parse_date.re"
+#line 1608 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -4139,7 +4139,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
-#line 1666 "ext/date/lib/parse_date.re"
+#line 1667 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4199,7 +4199,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
-#line 1412 "ext/date/lib/parse_date.re"
+#line 1413 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4481,7 +4481,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
-#line 1714 "ext/date/lib/parse_date.re"
+#line 1715 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -5208,7 +5208,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
-#line 1690 "ext/date/lib/parse_date.re"
+#line 1691 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5409,7 +5409,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
-#line 1384 "ext/date/lib/parse_date.re"
+#line 1385 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -6642,7 +6642,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
-#line 1528 "ext/date/lib/parse_date.re"
+#line 1529 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -7293,7 +7293,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
-#line 1586 "ext/date/lib/parse_date.re"
+#line 1587 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -9063,7 +9063,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
-#line 1289 "ext/date/lib/parse_date.re"
+#line 1290 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9634,7 +9634,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
-#line 1426 "ext/date/lib/parse_date.re"
+#line 1427 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9786,7 +9786,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
-#line 1144 "ext/date/lib/parse_date.re"
+#line 1145 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9815,7 +9815,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
-#line 1181 "ext/date/lib/parse_date.re"
+#line 1182 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -10150,7 +10150,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
-#line 1161 "ext/date/lib/parse_date.re"
+#line 1162 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10275,7 +10275,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
-#line 1343 "ext/date/lib/parse_date.re"
+#line 1344 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -11026,7 +11026,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
-#line 1358 "ext/date/lib/parse_date.re"
+#line 1359 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11073,7 +11073,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
-#line 1370 "ext/date/lib/parse_date.re"
+#line 1371 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11727,7 +11727,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
-#line 1329 "ext/date/lib/parse_date.re"
+#line 1330 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11846,7 +11846,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
-#line 1273 "ext/date/lib/parse_date.re"
+#line 1274 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -12094,7 +12094,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
-#line 1556 "ext/date/lib/parse_date.re"
+#line 1557 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12666,7 +12666,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
-#line 1301 "ext/date/lib/parse_date.re"
+#line 1302 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12718,7 +12718,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
-#line 1542 "ext/date/lib/parse_date.re"
+#line 1543 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12869,7 +12869,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
-#line 1577 "ext/date/lib/parse_date.re"
+#line 1578 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -13028,7 +13028,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
-#line 1398 "ext/date/lib/parse_date.re"
+#line 1399 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -13256,7 +13256,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
-#line 1509 "ext/date/lib/parse_date.re"
+#line 1510 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13284,7 +13284,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
-#line 1490 "ext/date/lib/parse_date.re"
+#line 1491 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13366,7 +13366,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
-#line 1476 "ext/date/lib/parse_date.re"
+#line 1477 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13482,7 +13482,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
-#line 1450 "ext/date/lib/parse_date.re"
+#line 1451 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13769,7 +13769,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
-#line 1438 "ext/date/lib/parse_date.re"
+#line 1439 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -14700,7 +14700,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
-#line 1315 "ext/date/lib/parse_date.re"
+#line 1316 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -15722,7 +15722,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
-#line 1207 "ext/date/lib/parse_date.re"
+#line 1208 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15836,7 +15836,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
-#line 1253 "ext/date/lib/parse_date.re"
+#line 1254 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -16753,7 +16753,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
-#line 1649 "ext/date/lib/parse_date.re"
+#line 1650 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16820,7 +16820,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
-#line 1122 "ext/date/lib/parse_date.re"
+#line 1123 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16949,7 +16949,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
-#line 1625 "ext/date/lib/parse_date.re"
+#line 1626 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -19649,7 +19649,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
-#line 1099 "ext/date/lib/parse_date.re"
+#line 1100 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -21382,11 +21382,12 @@ yy1387:
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21390 "ext/date/lib/parse_date.c"
+#line 21391 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21833,7 +21834,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21837 "ext/date/lib/parse_date.c"
+#line 21838 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21877,7 +21878,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21881 "ext/date/lib/parse_date.c"
+#line 21882 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23897,7 +23898,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 23901 "ext/date/lib/parse_date.c"
+#line 23902 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24047,7 +24048,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 24051 "ext/date/lib/parse_date.c"
+#line 24052 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24591,7 +24592,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 24595 "ext/date/lib/parse_date.c"
+#line 24596 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24764,7 +24765,7 @@ yy1537:
goto yy1531;
}
}
-#line 1775 "ext/date/lib/parse_date.re"
+#line 1776 "ext/date/lib/parse_date.re"
}
@@ -25070,6 +25071,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
break;
case 'e': /* timezone */
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 16c45a2119..5a8b6134b9 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
@@ -1073,6 +1073,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
@@ -2077,6 +2078,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
break;
case 'e': /* timezone */
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index 34de3b409c..d52c24d38f 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -4,7 +4,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index 8610803e39..e52868865b 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index b8d8448c94..009a2ad4e6 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 5e65a6e4cf..43eedf780c 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index 9667fa2dae..671d37fd9e 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index 4f67b7a6cb..6662d91b1b 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
index c4830bbef0..6085bb14da 100644
--- a/ext/date/lib/tm2unixtime.c
+++ b/ext/date/lib/tm2unixtime.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index a76fa80991..48709f42fc 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 7c4e7820bb..13e7b753d3 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2467,9 +2467,6 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
convert_to_long(*z_timezone_type);
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
- zend_error_handling error_handling;
-
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
convert_to_string(*z_timezone);
switch (Z_LVAL_PP(z_timezone_type)) {
@@ -2477,9 +2474,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
case TIMELIB_ZONETYPE_ABBR: {
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
- php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 1 TSRMLS_CC);
+ php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
efree(tmp);
- break;
+ return 1;
}
case TIMELIB_ZONETYPE_ID:
@@ -2493,15 +2490,10 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
- php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 1 TSRMLS_CC);
+ php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp_obj);
- break;
- default:
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- return 0;
+ return 1;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- return 1;
}
}
}
diff --git a/ext/date/tests/bug62561.phpt b/ext/date/tests/bug62561.phpt
new file mode 100644
index 0000000000..0ed32c15a1
--- /dev/null
+++ b/ext/date/tests/bug62561.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT)
+--FILE--
+<?php
+$tz = new DateTimeZone('America/New_York');
+$ts = new DateTime('@1341115200', $tz);
+$int = new DateInterval('P1D');
+$dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York'));
+$dayFromTs->add($int);
+
+echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n";
+echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n";
+?>
+--EXPECT--
+ts: 2012-07-01 04:00:00
+day from ts: 2012-07-02 04:00:00
diff --git a/ext/date/tests/bug62852.phpt b/ext/date/tests/bug62852.phpt
index 6426a80fb8..26de510215 100644
--- a/ext/date/tests/bug62852.phpt
+++ b/ext/date/tests/bug62852.phpt
@@ -2,14 +2,35 @@
Bug #62852 (Unserialize invalid DateTime causes crash)
--INI--
date.timezone=GMT
+--XFAIL--
+bug is not fixed yet
--FILE--
<?php
-try {
- $datetime = unserialize('O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}');
- var_dump($datetime);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
+$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
+
+global $foo;
+
+class Foo extends DateTime {
+ function __wakeup() {
+ global $foo;
+ $foo = $this;
+ parent::__wakeup();
+ }
}
+
+// Old test case
+try {
+ unserialize( $s1 );
+} catch ( Exception $e ) {}
+
+// My test case
+try {
+ unserialize( $s2 );
+} catch ( Exception $e ) {}
+var_dump( $foo );
+
+echo "okey";
?>
--EXPECTF--
-string(%d) "DateTime::__wakeup(): Failed to parse time string (%s) at position 12 (0): Double time specification"
+okey
diff --git a/ext/date/tests/bug62896.phpt b/ext/date/tests/bug62896.phpt
new file mode 100644
index 0000000000..7584546b5a
--- /dev/null
+++ b/ext/date/tests/bug62896.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #62896 Unixtimestamp may take on local times DST flag (this test will only be valid during CEST)
+--FILE--
+<?php
+ $tz = new DateTimeZone('Europe/Berlin');
+
+ echo "FROM TIMESTAMP, NO TZ:\n";
+
+ $date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ echo "FROM TIMESTAMP, WITH TZ:\n";
+
+ $date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
+ $date->setTimezone($tz);
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ echo "FROM STRING:\n";
+
+ $date = new DateTime('2012-08-22 00:00:00 CEST', $tz);
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+--EXPECT--
+FROM TIMESTAMP, NO TZ:
+2012-08-21 22:00:00 GMT+0000 (offset 0)
+2012-08-21 22:00:00 GMT+0000 (offset 0)
+FROM TIMESTAMP, WITH TZ:
+2012-08-22 00:00:00 CEST (offset 7200)
+2012-08-22 00:00:00 CEST (offset 7200)
+FROM STRING:
+2012-08-22 00:00:00 CEST (offset 7200)
+2012-08-22 00:00:00 CEST (offset 7200)
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index 5c26b4fd9f..cfce91e080 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 3530cb493c..7cdca00498 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index 600b8dd0f9..014db032eb 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index 828abe0315..062cffb05c 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c
index e869d512fb..b56cbf26f8 100644
--- a/ext/dba/libcdb/uint32.c
+++ b/ext/dba/libcdb/uint32.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h
index 692590e227..68ea1c0cd8 100644
--- a/ext/dba/libcdb/uint32.h
+++ b/ext/dba/libcdb/uint32.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index bf851847d5..c17a295438 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index e7ce3a7640..65d099fbc7 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 35930d1028..cd53f4adf0 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index e69fd08b06..5b7e377d86 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index f1ab2871a8..e282f30146 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -29,7 +29,7 @@
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
- ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
+ ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0)
ZEND_END_ARG_INFO();
/* }}} */
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 30364fb978..15f6a6dadd 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
---- libmagic.origin/apprentice.c 2012-07-15 18:17:24.802087661 +0800
-+++ libmagic/apprentice.c 2012-07-15 18:22:49.650087425 +0800
+--- libmagic.origin/apprentice.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/apprentice.c 2012-09-11 11:36:51.000000000 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -317,13 +317,13 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
const char *fn, int action)
{
- int errs = 0;
-+ int errs = 0, mflen = 0;
++ int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
- size_t slen, files = 0, maxfiles = 0;
- char **filearr = NULL, *mfn;
+ size_t files = 0, maxfiles = 0;
-+ char **filearr = NULL, mfn[MAXPATHLEN];
++ char **filearr = NULL;
struct stat st;
DIR *dir;
struct dirent *d;
@@ -341,7 +341,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
marraycount = 0;
/* print silly verbose header for USG compat. */
-@@ -778,14 +773,16 @@
+@@ -778,14 +773,18 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -349,6 +349,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+ /* FIXME: Read file names and sort them to prevent
+ non-determinism. See Debian bug #488562. */
+ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
++ int mflen;
++ char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
@@ -360,7 +362,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
-@@ -793,7 +790,6 @@
+@@ -793,7 +792,6 @@
goto out;
}
if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
@@ -368,7 +370,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
-@@ -803,20 +799,19 @@
+@@ -803,20 +801,19 @@
if ((filearr = CAST(char **,
realloc(filearr, mlen))) == NULL) {
file_oomem(ms, mlen);
@@ -379,7 +381,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
}
- filearr[files++] = mfn;
-+ filearr[files++] = estrndup(mfn, mflen);
++ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
@@ -391,7 +393,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
free(filearr);
} else
-@@ -882,12 +877,7 @@
+@@ -882,12 +879,7 @@
for (i = 0; i < marraycount; i++)
mentrycount += marray[i].cont_count;
@@ -405,7 +407,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
mentrycount = 0;
for (i = 0; i < marraycount; i++) {
-@@ -896,9 +886,14 @@
+@@ -896,9 +888,14 @@
mentrycount += marray[i].cont_count;
}
out:
@@ -423,7 +425,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
if (errs) {
*magicp = NULL;
*nmagicp = 0;
-@@ -1175,14 +1170,13 @@
+@@ -1175,14 +1172,13 @@
return -1;
}
me = &(*mentryp)[*nmentryp - 1];
@@ -442,7 +444,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m = nm;
me->max_count = CAST(uint32_t, cnt);
}
-@@ -1194,23 +1188,13 @@
+@@ -1194,23 +1190,13 @@
struct magic_entry *mp;
maxmagic += ALLOC_INCR;
@@ -469,7 +471,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m;
me->max_count = ALLOC_CHUNK;
} else
-@@ -1353,6 +1337,10 @@
+@@ -1353,6 +1339,10 @@
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
@@ -480,7 +482,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return -1;
}
-@@ -1361,7 +1349,7 @@
+@@ -1361,7 +1351,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -489,7 +491,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
-@@ -1370,7 +1358,7 @@
+@@ -1370,7 +1360,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -498,7 +500,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
uint64_t val;
++l;
m->mask_op |= op;
-@@ -1558,11 +1546,6 @@
+@@ -1558,11 +1548,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -510,7 +512,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
if (m->cont_level == 0)
++(*nmentryp); /* make room for next */
-@@ -2195,56 +2178,69 @@
+@@ -2195,56 +2180,69 @@
/*
* handle a compiled file.
@@ -603,7 +605,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
ptr = (uint32_t *)(void *)*magicp;
if (*ptr != MAGICNO) {
if (swap4(*ptr) != MAGICNO) {
-@@ -2259,35 +2255,55 @@
+@@ -2259,35 +2257,55 @@
else
version = ptr[1];
if (version != VERSIONNO) {
@@ -675,7 +677,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return -1;
}
-@@ -2301,42 +2317,49 @@
+@@ -2301,42 +2319,49 @@
apprentice_compile(struct magic_set *ms, struct magic **magicp,
uint32_t *nmagicp, const char *fn)
{
@@ -736,7 +738,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return rv;
}
-@@ -2349,6 +2372,7 @@
+@@ -2349,6 +2374,7 @@
{
const char *p, *q;
char *buf;
@@ -744,7 +746,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
-@@ -2370,14 +2394,14 @@
+@@ -2370,14 +2396,14 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -763,7 +765,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
-@@ -2467,7 +2491,7 @@
+@@ -2467,7 +2493,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -773,8 +775,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
---- libmagic.origin/ascmagic.c 2012-07-15 18:17:24.762087659 +0800
-+++ libmagic/ascmagic.c 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/ascmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/ascmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -799,8 +801,8 @@ diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.origin/cdf.c libmagic/cdf.c
---- libmagic.origin/cdf.c 2012-07-15 18:17:24.822087659 +0800
-+++ libmagic/cdf.c 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/cdf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf.c 2012-09-11 11:33:55.000000000 +0800
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -863,8 +865,8 @@ diff -u libmagic.origin/cdf.c libmagic/cdf.c
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.origin/cdf.h libmagic/cdf.h
---- libmagic.origin/cdf.h 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/cdf.h 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/cdf.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf.h 2012-09-11 11:33:55.000000000 +0800
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -901,8 +903,8 @@ diff -u libmagic.origin/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
---- libmagic.origin/cdf_time.c 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/cdf_time.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/cdf_time.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf_time.c 2012-09-11 11:33:55.000000000 +0800
@@ -96,7 +96,7 @@
}
@@ -960,8 +962,8 @@ diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
static const char *ref = "Sat Apr 23 01:30:00 1977";
char *p, *q;
diff -u libmagic.origin/compress.c libmagic/compress.c
---- libmagic.origin/compress.c 2012-07-15 18:17:24.730087657 +0800
-+++ libmagic/compress.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/compress.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/compress.c 2012-09-11 11:33:55.000000000 +0800
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1122,9 +1124,10 @@ diff -u libmagic.origin/compress.c libmagic/compress.c
}
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
+Only in libmagic: diff
diff -u libmagic.origin/file.h libmagic/file.h
---- libmagic.origin/file.h 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/file.h 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/file.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/file.h 2012-09-11 11:33:55.000000000 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1296,8 +1299,8 @@ diff -u libmagic.origin/file.h libmagic/file.h
+
#endif /* __file_h__ */
diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
---- libmagic.origin/fsmagic.c 2012-07-15 18:17:24.730087657 +0800
-+++ libmagic/fsmagic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/fsmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/fsmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1508,10 +1511,10 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
-#else
- if (file_printf(ms, "block special") == -1)
- return -1;
- #endif
+-#endif
- }
- return 1;
--#endif
+ #endif
- /* TODO add code to handle V7 MUX and Blit MUX files */
+
#ifdef S_IFIFO
@@ -1621,8 +1624,8 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
/*
diff -u libmagic.origin/funcs.c libmagic/funcs.c
---- libmagic.origin/funcs.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/funcs.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/funcs.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/funcs.c 2012-09-11 11:33:55.000000000 +0800
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1916,10 +1919,9 @@ diff -u libmagic.origin/funcs.c libmagic/funcs.c
+ return rep_cnt;
}
+
-Common subdirectories: libmagic.origin/.libs and libmagic/.libs
diff -u libmagic.origin/magic.c libmagic/magic.c
---- libmagic.origin/magic.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/magic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/magic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/magic.c 2012-09-11 11:33:55.000000000 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2296,8 +2298,8 @@ diff -u libmagic.origin/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.origin/magic.h libmagic/magic.h
---- libmagic.origin/magic.h 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/magic.h 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/magic.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/magic.h 2012-09-11 11:33:55.000000000 +0800
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2315,8 +2317,8 @@ diff -u libmagic.origin/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.origin/print.c libmagic/print.c
---- libmagic.origin/print.c 2012-07-15 18:21:02.846087501 +0800
-+++ libmagic/print.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/print.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/print.c 2012-09-11 11:33:55.000000000 +0800
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
@@ -2509,206 +2511,9 @@ diff -u libmagic.origin/print.c libmagic/print.c
}
protected const char *
-diff -u libmagic.origin/print.c.rej libmagic/print.c.rej
---- libmagic.origin/print.c.rej 2012-07-15 18:17:24.762087659 +0800
-+++ libmagic/print.c.rej 2012-07-15 18:20:27.186087168 +0800
-@@ -1,12 +1,184 @@
----- libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
--+++ libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
--@@ -29,9 +29,6 @@
-- * print.c - debugging printout routines
-- */
-+--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
-++++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
-+@@ -48,174 +51,21 @@
-
---#include "php.h"
---#include "main/snprintf.h"
-+ #define SZOF(a) (sizeof(a) / sizeof(a[0]))
-+
-+-#ifndef COMPILE_ONLY
-+-protected void
-+-file_mdump(struct magic *m)
-+-{
-+- private const char optyp[] = { FILE_OPS };
-+-
-+- (void) fprintf(stderr, "%u: %.*s %u", m->lineno,
-+- (m->cont_level & 7) + 1, ">>>>>>>>", m->offset);
-+-
-+- if (m->flag & INDIR) {
-+- (void) fprintf(stderr, "(%s,",
-+- /* Note: type is unsigned */
-+- (m->in_type < file_nnames) ?
-+- file_names[m->in_type] : "*bad*");
-+- if (m->in_op & FILE_OPINVERSE)
-+- (void) fputc('~', stderr);
-+- (void) fprintf(stderr, "%c%u),",
-+- ((size_t)(m->in_op & FILE_OPS_MASK) <
-+- SZOF(optyp)) ?
-+- optyp[m->in_op & FILE_OPS_MASK] : '?',
-+- m->in_offset);
-+- }
-+- (void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
-+- /* Note: type is unsigned */
-+- (m->type < file_nnames) ? file_names[m->type] : "*bad*");
-+- if (m->mask_op & FILE_OPINVERSE)
-+- (void) fputc('~', stderr);
-+-
-+- if (IS_STRING(m->type)) {
-+- if (m->str_flags) {
-+- (void) fputc('/', stderr);
-+- if (m->str_flags & STRING_COMPACT_WHITESPACE)
-+- (void) fputc(CHAR_COMPACT_WHITESPACE, stderr);
-+- if (m->str_flags & STRING_COMPACT_OPTIONAL_WHITESPACE)
-+- (void) fputc(CHAR_COMPACT_OPTIONAL_WHITESPACE,
-+- stderr);
-+- if (m->str_flags & STRING_IGNORE_LOWERCASE)
-+- (void) fputc(CHAR_IGNORE_LOWERCASE, stderr);
-+- if (m->str_flags & STRING_IGNORE_UPPERCASE)
-+- (void) fputc(CHAR_IGNORE_UPPERCASE, stderr);
-+- if (m->str_flags & REGEX_OFFSET_START)
-+- (void) fputc(CHAR_REGEX_OFFSET_START, stderr);
-+- if (m->str_flags & STRING_TEXTTEST)
-+- (void) fputc(CHAR_TEXTTEST, stderr);
-+- if (m->str_flags & STRING_BINTEST)
-+- (void) fputc(CHAR_BINTEST, stderr);
-+- if (m->str_flags & PSTRING_1_BE)
-+- (void) fputc(CHAR_PSTRING_1_BE, stderr);
-+- if (m->str_flags & PSTRING_2_BE)
-+- (void) fputc(CHAR_PSTRING_2_BE, stderr);
-+- if (m->str_flags & PSTRING_2_LE)
-+- (void) fputc(CHAR_PSTRING_2_LE, stderr);
-+- if (m->str_flags & PSTRING_4_BE)
-+- (void) fputc(CHAR_PSTRING_4_BE, stderr);
-+- if (m->str_flags & PSTRING_4_LE)
-+- (void) fputc(CHAR_PSTRING_4_LE, stderr);
-+- if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF)
-+- (void) fputc(
-+- CHAR_PSTRING_LENGTH_INCLUDES_ITSELF,
-+- stderr);
-+- }
-+- if (m->str_range)
-+- (void) fprintf(stderr, "/%u", m->str_range);
-+- }
-+- else {
-+- if ((size_t)(m->mask_op & FILE_OPS_MASK) < SZOF(optyp))
-+- (void) fputc(optyp[m->mask_op & FILE_OPS_MASK], stderr);
-+- else
-+- (void) fputc('?', stderr);
-+-
-+- if (m->num_mask) {
-+- (void) fprintf(stderr, "%.8llx",
-+- (unsigned long long)m->num_mask);
-+- }
-+- }
-+- (void) fprintf(stderr, ",%c", m->reln);
-+-
-+- if (m->reln != 'x') {
-+- switch (m->type) {
-+- case FILE_BYTE:
-+- case FILE_SHORT:
-+- case FILE_LONG:
-+- case FILE_LESHORT:
-+- case FILE_LELONG:
-+- case FILE_MELONG:
-+- case FILE_BESHORT:
-+- case FILE_BELONG:
-+- (void) fprintf(stderr, "%d", m->value.l);
-+- break;
-+- case FILE_BEQUAD:
-+- case FILE_LEQUAD:
-+- case FILE_QUAD:
-+- (void) fprintf(stderr, "%" INT64_T_FORMAT "d",
-+- (unsigned long long)m->value.q);
-+- break;
-+- case FILE_PSTRING:
-+- case FILE_STRING:
-+- case FILE_REGEX:
-+- case FILE_BESTRING16:
-+- case FILE_LESTRING16:
-+- case FILE_SEARCH:
-+- file_showstr(stderr, m->value.s, (size_t)m->vallen);
-+- break;
-+- case FILE_DATE:
-+- case FILE_LEDATE:
-+- case FILE_BEDATE:
-+- case FILE_MEDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime(m->value.l, 1));
-+- break;
-+- case FILE_LDATE:
-+- case FILE_LELDATE:
-+- case FILE_BELDATE:
-+- case FILE_MELDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime(m->value.l, 0));
-+- break;
-+- case FILE_QDATE:
-+- case FILE_LEQDATE:
-+- case FILE_BEQDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime((uint32_t)m->value.q, 1));
-+- break;
-+- case FILE_QLDATE:
-+- case FILE_LEQLDATE:
-+- case FILE_BEQLDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime((uint32_t)m->value.q, 0));
-+- break;
-+- case FILE_FLOAT:
-+- case FILE_BEFLOAT:
-+- case FILE_LEFLOAT:
-+- (void) fprintf(stderr, "%G", m->value.f);
-+- break;
-+- case FILE_DOUBLE:
-+- case FILE_BEDOUBLE:
-+- case FILE_LEDOUBLE:
-+- (void) fprintf(stderr, "%G", m->value.d);
-+- break;
-+- case FILE_DEFAULT:
-+- /* XXX - do anything here? */
-+- break;
-+- default:
-+- (void) fputs("*bad*", stderr);
-+- break;
-+- }
-+- }
-+- (void) fprintf(stderr, ",\"%s\"]\n", m->desc);
-+-}
-+-#endif
-+-
-+ /*VARARGS*/
-+ protected void
-+ file_magwarn(struct magic_set *ms, const char *f, ...)
-+ {
-+ va_list va;
-++ char *expanded_format;
-++ TSRMLS_FETCH();
-+
-+- /* cuz we use stdout for most, stderr here */
-+- (void) fflush(stdout);
- -
-- #include "file.h"
-+- if (ms->file)
-+- (void) fprintf(stderr, "%s, %lu: ", ms->file,
-+- (unsigned long)ms->line);
-+- (void) fprintf(stderr, "Warning: ");
-+ va_start(va, f);
-+- (void) vfprintf(stderr, f, va);
-++ vasprintf(&expanded_format, f, va);
-+ va_end(va);
-+- (void) fputc('\n', stderr);
-++
-++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
-++
-++ free(expanded_format);
-+ }
-
-- #ifndef lint
-+ protected const char *
diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
---- libmagic.origin/readcdf.c 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/readcdf.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/readcdf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/readcdf.c 2012-09-11 11:33:55.000000000 +0800
@@ -30,7 +30,11 @@
#endif
@@ -2755,8 +2560,8 @@ diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
diff -u libmagic.origin/readelf.c libmagic/readelf.c
---- libmagic.origin/readelf.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/readelf.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/readelf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/readelf.c 2012-09-11 11:33:55.000000000 +0800
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2912,8 +2717,8 @@ diff -u libmagic.origin/readelf.c libmagic/readelf.c
if (fstat(fd, &st) == -1) {
diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
---- libmagic.origin/softmagic.c 2012-07-15 18:17:24.722087658 +0800
-+++ libmagic/softmagic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/softmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/softmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 98bde27a2d..d11bd159a8 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -753,11 +753,11 @@ private int
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
{
- int errs = 0, mflen = 0;
+ int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
size_t files = 0, maxfiles = 0;
- char **filearr = NULL, mfn[MAXPATHLEN];
+ char **filearr = NULL;
struct stat st;
DIR *dir;
struct dirent *d;
@@ -776,6 +776,8 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
/* FIXME: Read file names and sort them to prevent
non-determinism. See Debian bug #488562. */
if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
+ int mflen;
+ char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
@@ -804,7 +806,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
goto out;
}
}
- filearr[files++] = estrndup(mfn, mflen);
+ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h
index daa688b4ac..2ec2f62fae 100644
--- a/ext/filter/filter_private.h
+++ b/ext/filter/filter_private.h
@@ -99,12 +99,14 @@
} \
return; \
-#define PHP_FILTER_TRIM_DEFAULT(p, len) { \
+#define PHP_FILTER_TRIM_DEFAULT(p, len) PHP_FILTER_TRIM_DEFAULT_EX(p, len, 1);
+
+#define PHP_FILTER_TRIM_DEFAULT_EX(p, len, return_if_empty) { \
while ((len > 0) && (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v' || *p == '\n')) { \
p++; \
len--; \
} \
- if (len < 1) { \
+ if (len < 1 && return_if_empty) { \
RETURN_VALIDATION_FAILED \
} \
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 5c3811ab25..4de6b83e00 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -235,12 +235,15 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
int len = Z_STRLEN_P(value);
int ret;
- PHP_FILTER_TRIM_DEFAULT(str, len);
+ PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0);
/* returns true for "1", "true", "on" and "yes"
* returns false for "0", "false", "off", "no", and ""
* null otherwise. */
switch (len) {
+ case 0:
+ ret = 0;
+ break;
case 1:
if (*str == '1') {
ret = 1;
@@ -286,7 +289,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
ret = -1;
}
- if (ret == -1) {
+ if (ret == -1) {
RETURN_VALIDATION_FAILED
} else {
zval_dtor(value);
diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt
new file mode 100644
index 0000000000..3f365cc431
--- /dev/null
+++ b/ext/filter/tests/bug49510.phpt
@@ -0,0 +1,36 @@
+--TEST--
+#49510 boolean validation fails with FILTER_NULL_ON_FAILURE
+--FILE--
+<?php
+var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+
+var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+
+var_dump(filter_var("invalid", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+?>
+==DONE==
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+NULL
+==DONE==
diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c
index c83b0ad13e..f4165d52b7 100644
--- a/ext/gd/libgd/xbm.c
+++ b/ext/gd/libgd/xbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 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 |
diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c
index a0ee7c145f..282172224c 100644
--- a/ext/intl/common/common_error.c
+++ b/ext/intl/common/common_error.c
@@ -240,7 +240,9 @@ void intl_expose_icu_error_codes( INIT_FUNC_ARGS )
INTL_EXPOSE_CONST( U_IDNA_ACE_PREFIX_ERROR );
INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR );
INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR );
+#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 6
INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR );
+#endif
#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 8
INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR );
#endif
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 801ca3379e..49f316f787 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -92,7 +92,7 @@ zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC)
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index 8f399a6773..2246cd29a5 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -86,7 +86,7 @@ zend_object_value NumberFormatter_object_clone(zval *object TSRMLS_DC)
NumberFormatter_object *nfo, *new_nfo;
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index da1e1e595a..bb3b55f39c 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -84,7 +84,7 @@ zend_object_value MessageFormatter_object_clone(zval *object TSRMLS_DC)
MessageFormatter_object *mfo, *new_mfo;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index efe0ddd242..90e3573c1b 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -70,7 +70,7 @@
#include "idn/idn.h"
-#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
+#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
# include "spoofchecker/spoofchecker_class.h"
# include "spoofchecker/spoofchecker.h"
# include "spoofchecker/spoofchecker_create.h"
@@ -646,7 +646,7 @@ PHP_MINIT_FUNCTION( intl )
/* Expose IDN constants to PHP scripts. */
idn_register_constants(INIT_FUNC_ARGS_PASSTHRU);
-#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
+#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
/* Register 'Spoofchecker' PHP class */
spoofchecker_register_Spoofchecker_class( TSRMLS_C );
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 507a2ca98e..6c2b79034d 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -127,7 +127,7 @@ static zend_object_value spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ *
sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC);
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC);
- new_obj_val = Spoofchecker_ce_ptr->create_object(Spoofchecker_ce_ptr TSRMLS_CC);
+ new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_sfo->zo, new_obj_val, &sfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/tests/bug62915-2.phpt b/ext/intl/tests/bug62915-2.phpt
new file mode 100644
index 0000000000..bcb069cab6
--- /dev/null
+++ b/ext/intl/tests/bug62915-2.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #62915: cloning of several classes is defective
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');
+--FILE--
+<?php
+class A extends IntlDateFormatter {
+ static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
+ 'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
+}
+class B extends NumberFormatter {
+ static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
+}
+class C extends MessageFormatter {
+ static $ARGS = array("en_US", "foo");
+}
+class D extends Spoofchecker {
+ static $ARGS = array();
+}
+
+foreach (range('A', 'D') as $subclass) {
+ $rc = new ReflectionClass($subclass);
+ $obj = $rc->newInstanceArgs($subclass::$ARGS);
+ $clone = clone $obj;
+ var_dump(get_class($clone));
+}
+--EXPECT--
+string(1) "A"
+string(1) "B"
+string(1) "C"
+string(1) "D"
diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c
index 8d4d0649e9..5ef80fb482 100644
--- a/ext/intl/transliterator/transliterator_class.c
+++ b/ext/intl/transliterator/transliterator_class.c
@@ -162,7 +162,7 @@ static zend_object_value Transliterator_clone_obj( zval *object TSRMLS_DC )
to_orig = zend_object_store_get_object( object TSRMLS_CC );
intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC );
- ret_val = Transliterator_ce_ptr->create_object( Transliterator_ce_ptr TSRMLS_CC );
+ ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC );
to_new = zend_object_store_get_object_by_handle( ret_val.handle TSRMLS_CC );
zend_objects_clone_members( &to_new->zo, ret_val,
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 0d2b53a7ca..76654edbf8 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -2715,9 +2715,10 @@ PHP_FUNCTION(mb_substr)
char *str, *encoding;
long from, len;
int mblen, str_len, encoding_len;
+ zval **z_len = NULL;
mbfl_string string, result, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", &str, &str_len, &from, &len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2736,8 +2737,11 @@ PHP_FUNCTION(mb_substr)
string.val = (unsigned char *)str;
string.len = str_len;
- if (argc < 3) {
+ if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) {
len = str_len;
+ } else {
+ convert_to_long_ex(z_len);
+ len = Z_LVAL_PP(z_len);
}
/* measures length */
@@ -2788,13 +2792,14 @@ PHP_FUNCTION(mb_strcut)
char *encoding;
long from, len;
int encoding_len;
+ zval **z_len = NULL;
mbfl_string string, result, *ret;
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", (char **)&string.val, (int **)&string.len, &from, &len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2806,8 +2811,11 @@ PHP_FUNCTION(mb_strcut)
}
}
- if (argc < 3) {
+ if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) {
len = string.len;
+ } else {
+ convert_to_long_ex(z_len);
+ len = Z_LVAL_PP(z_len);
}
/* if "from" position is negative, count start position from the end
diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
index e4a235df30..5fb642f9b2 100644
--- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
+++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
@@ -28,5 +28,3 @@ baz
baz
foo
==DONE==
---XFAIL--
-mb functions fail to allow null instead of actual value
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 0634e96288..976eb9e846 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -49,8 +49,8 @@ AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[
AC_DEFUN([AC_OCI8IC_VERSION],[
AC_MSG_CHECKING([Oracle Instant Client library version compatibility])
OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME
- OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc
- OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -1`
+ OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc
+ OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -n1`
if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then
if test ! -f "$OCI8_LCS_BASE"; then
AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found])
@@ -65,7 +65,7 @@ AC_DEFUN([AC_OCI8IC_VERSION],[
AC_DEFUN([AC_OCI8_ORACLE_VERSION],[
AC_MSG_CHECKING([Oracle library version compatibility])
OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
- OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc
+ OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc
if test -s "$OCI8_DIR/orainst/unix.rgs"; then
OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3
@@ -278,7 +278,7 @@ if test "$PHP_OCI8" != "no"; then
dnl user must pass in the library directory. But on Linux we default
dnl to the most recent version in /usr/lib which is where the Oracle
dnl Instant Client RPM gets installed.
- PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'`
+ PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -n1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'`
if test -z "$PHP_OCI8_INSTANT_CLIENT"; then
AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR])
fi
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index d3a912832f..eac3f06552 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -37,8 +37,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<time>12:00:00</time>
<version>
- <release>1.4.7</release>
- <api>1.4.7</api>
+ <release>1.4.8</release>
+ <api>1.4.8</api>
</version>
<stability>
<release>stable</release>
@@ -46,11 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- Fixed bug #59985 (show normal warning text for OCI_NO_DATA)
- Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup)
- Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc)
- Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size
- Improve internal initalization failure error messages
+ Fixed bug #60901 (Improve "tail" syntax for AIX installation)
</notes>
<contents>
<dir name="/">
@@ -416,6 +412,25 @@ http://pear.php.net/dtd/package-2.0.xsd">
<release>
<version>
+ <release>1.4.7</release>
+ <api>1.4.7</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP</license>
+ <notes>
+ Fixed bug #59985 (show normal warning text for OCI_NO_DATA)
+ Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup)
+ Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc)
+ Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size
+ Improve internal initalization failure error messages
+ </notes>
+</release>
+
+<release>
+ <version>
<release>1.4.6</release>
<api>1.4.6</api>
</version>
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7187a9601e..2b8cfd571a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -69,7 +69,13 @@
#define OPENSSL_ALGO_MD2 4
#endif
#define OPENSSL_ALGO_DSS1 5
-
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+#define OPENSSL_ALGO_SHA224 6
+#define OPENSSL_ALGO_SHA256 7
+#define OPENSSL_ALGO_SHA384 8
+#define OPENSSL_ALGO_SHA512 9
+#define OPENSSL_ALGO_RMD160 10
+#endif
#define DEBUG_SMIME 0
/* FIXME: Use the openssl constants instead of
@@ -954,6 +960,23 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */
case OPENSSL_ALGO_DSS1:
mdtype = (EVP_MD *) EVP_dss1();
break;
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+ case OPENSSL_ALGO_SHA224:
+ mdtype = (EVP_MD *) EVP_sha224();
+ break;
+ case OPENSSL_ALGO_SHA256:
+ mdtype = (EVP_MD *) EVP_sha256();
+ break;
+ case OPENSSL_ALGO_SHA384:
+ mdtype = (EVP_MD *) EVP_sha384();
+ break;
+ case OPENSSL_ALGO_SHA512:
+ mdtype = (EVP_MD *) EVP_sha512();
+ break;
+ case OPENSSL_ALGO_RMD160:
+ mdtype = (EVP_MD *) EVP_ripemd160();
+ break;
+#endif
default:
return NULL;
break;
@@ -1048,6 +1071,13 @@ PHP_MINIT_FUNCTION(openssl)
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA384", OPENSSL_ALGO_SHA384, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA512", OPENSSL_ALGO_SHA512, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RMD160", OPENSSL_ALGO_RMD160, CONST_CS|CONST_PERSISTENT);
+#endif
/* flags for S/MIME */
REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT);
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index c9d707280c..f61364cde9 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -275,7 +275,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
get to the end without encountering a delimiter. */
while (isspace((int)*(unsigned char *)p)) p++;
if (*p == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ p < regex + regex_len ? "Null byte in regex" : "Empty regular expression");
return NULL;
}
@@ -292,21 +293,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
delimiter = pp[5];
end_delimiter = delimiter;
+ pp = p;
+
if (start_delimiter == end_delimiter) {
/* We need to iterate through the pattern, searching for the ending delimiter,
but skipping the backslashed delimiters. If the ending delimiter is not
found, display a warning. */
- pp = p;
while (*pp != 0) {
if (*pp == '\\' && pp[1] != 0) pp++;
else if (*pp == delimiter)
break;
pp++;
}
- if (*pp == 0) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
- return NULL;
- }
} else {
/* We iterate through the pattern, searching for the matching ending
* delimiter. For each matching starting delimiter, we increment nesting
@@ -314,7 +312,6 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
* reach the end of the pattern without matching, display a warning.
*/
int brackets = 1; /* brackets nesting level */
- pp = p;
while (*pp != 0) {
if (*pp == '\\' && pp[1] != 0) pp++;
else if (*pp == end_delimiter && --brackets <= 0)
@@ -323,10 +320,17 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
brackets++;
pp++;
}
- if (*pp == 0) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", end_delimiter);
- return NULL;
+ }
+
+ if (*pp == 0) {
+ if (pp < regex + regex_len) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ } else if (start_delimiter == end_delimiter) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
+ } else {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
}
+ return NULL;
}
/* Make a copy of the actual pattern. */
@@ -337,7 +341,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
/* Parse through the options, setting appropriate flags. Display
a warning if we encounter an unknown modifier. */
- while (*pp != 0) {
+ while (pp < regex + regex_len) {
switch (*pp++) {
/* Perl compatible options */
case 'i': coptions |= PCRE_CASELESS; break;
@@ -368,7 +372,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
break;
default:
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ if (pp[-1]) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ } else {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ }
efree(pattern);
return NULL;
}
diff --git a/ext/pcre/tests/null_bytes.phpt b/ext/pcre/tests/null_bytes.phpt
new file mode 100644
index 0000000000..9a3f433ffb
--- /dev/null
+++ b/ext/pcre/tests/null_bytes.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Zero byte test
+--FILE--
+<?php
+
+preg_match("\0//i", "");
+preg_match("/\0/i", "");
+preg_match("//\0i", "");
+preg_match("//i\0", "");
+preg_match("/\\\0/i", "");
+
+preg_match("\0[]i", "");
+preg_match("[\0]i", "");
+preg_match("[]\0i", "");
+preg_match("[]i\0", "");
+preg_match("[\\\0]i", "");
+
+preg_replace("/foo/e\0/i", "echo('Eek');", "");
+
+?>
+--EXPECTF--
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 3
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 4
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 5
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 6
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 7
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 9
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 10
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 11
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 12
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 13
+
+Warning: preg_replace(): Null byte in regex in %snull_bytes.php on line 15
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 84d603b591..5addec4ff2 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1818,11 +1818,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
- if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) {
- if ((*tmp)->min_occurs > 0) {
+ if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) {
+ if (!strict || (*tmp)->min_occurs > 0) {
return 0;
}
}
+ strict = 1;
zend_hash_move_forward_ex(model->u.content, &pos);
}
return 1;
@@ -1845,7 +1846,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
return ret;
}
case XSD_CONTENT_GROUP: {
- return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC);
+ return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
}
default:
break;
diff --git a/ext/soap/tests/bugs/bug50997.phpt b/ext/soap/tests/bugs/bug50997.phpt
new file mode 100644
index 0000000000..0508aaccdc
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$soapClient = new SoapClient(__DIR__ . '/bug50997.wsdl', array('trace' => 1, 'exceptions'=>0));
+$params = array('code'=>'foo');
+$soapClient->newOperation($params);
+echo $soapClient->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/service2/"><SOAP-ENV:Body><ns1:NewOperation><code>foo</code></ns1:NewOperation></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug50997.wsdl b/ext/soap/tests/bugs/bug50997.wsdl
new file mode 100644
index 0000000000..16c6d36752
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/service2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="service2" targetNamespace="http://www.example.org/service2/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.example.org/service2/">
+ <xsd:element name="NewOperation">
+ <xsd:complexType>
+ <xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"> </xsd:element>
+ <xsd:element name="surName" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:element name="code" type="xsd:string"/>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="NewOperationResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="NewOperationRequest">
+ <wsdl:part element="tns:NewOperation" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="NewOperationResponse">
+ <wsdl:part element="tns:NewOperationResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:portType name="service2">
+ <wsdl:operation name="NewOperation">
+ <wsdl:input message="tns:NewOperationRequest"/>
+ <wsdl:output message="tns:NewOperationResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="service2SOAP" type="tns:service2">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="NewOperation">
+ <soap:operation soapAction="http://www.example.org/service2/NewOperation"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="service2">
+ <wsdl:port binding="tns:service2SOAP" name="service2SOAP">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+ </wsdl:definitions>
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h
index ccd9b1d2a8..5619c9c7fb 100644
--- a/ext/sockets/multicast.h
+++ b/ext/sockets/multicast.h
@@ -19,11 +19,12 @@
/* $Id$ */
#if defined(MCAST_JOIN_GROUP) && \
- (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API))
+ (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \
+ !defined(__APPLE__)
#define RFC3678_API 1
/* has block/unblock and source membership, in this case for both IPv4 and IPv6 */
#define HAS_MCAST_EXT 1
-#elif defined(IP_ADD_SOURCE_MEMBERSHIP)
+#elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__)
/* has block/unblock and source membership, but only for IPv4 */
#define HAS_MCAST_EXT 1
#endif
diff --git a/ext/sockets/tests/bug63000.phpt b/ext/sockets/tests/bug63000.phpt
new file mode 100644
index 0000000000..c806ba4c08
--- /dev/null
+++ b/ext/sockets/tests/bug63000.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #63000: Multicast on OSX
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+ die('skip sockets extension not available.');
+}
+if (PHP_OS !== 'Darwin') {
+ die('is not OSX.');
+}
+--FILE--
+<?php
+$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+socket_bind($socket, '0.0.0.0', 31057);
+
+$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array(
+ "group" => '224.0.0.251',
+ "interface" => 0,
+));
+var_dump($so);
+--EXPECTF--
+bool(true)
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 1e4577a3f9..3c6b41edbc 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -306,41 +306,41 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
long index;
HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
-/* We cannot get the pointer pointer so we don't allow it here for now
- if (check_inherited && intern->fptr_offset_get) {
- return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset);
- }*/
-
if (!offset) {
return &EG(uninitialized_zval_ptr);
}
if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->nApplyCount > 0)) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return &EG(uninitialized_zval_ptr);;
+ return &EG(error_zval_ptr);;
}
switch(Z_TYPE_P(offset)) {
+ case IS_NULL:
+ Z_STRVAL_P(offset) = "";
+ Z_STRLEN_P(offset) = 0;
case IS_STRING:
if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
- if (type == BP_VAR_W || type == BP_VAR_RW) {
- zval *value;
- ALLOC_INIT_ZVAL(value);
- zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
- if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) != FAILURE) {
- return retval;
- } else {
- return &EG(uninitialized_zval_ptr);
+ switch (type) {
+ case BP_VAR_R:
+ zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
+ case BP_VAR_UNSET:
+ case BP_VAR_IS:
+ retval = &EG(uninitialized_zval_ptr);
+ break;
+ case BP_VAR_RW:
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ case BP_VAR_W: {
+ zval *value;
+ ALLOC_INIT_ZVAL(value);
+ zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), (void **)&retval);
}
- } else {
- zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
- return &EG(uninitialized_zval_ptr);
}
- } else {
- return retval;
}
- case IS_DOUBLE:
+ return retval;
case IS_RESOURCE:
+ zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(offset), Z_LVAL_P(offset));
+ case IS_DOUBLE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
@@ -349,26 +349,27 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
index = Z_LVAL_P(offset);
}
if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) {
- if (type == BP_VAR_W || type == BP_VAR_RW) {
- zval *value;
- ALLOC_INIT_ZVAL(value);
- zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL);
- if (zend_hash_index_find(ht, index, (void **) &retval) != FAILURE) {
- return retval;
- } else {
- return &EG(uninitialized_zval_ptr);
- }
- } else {
- zend_error(E_NOTICE, "Undefined offset: %ld", index);
- return &EG(uninitialized_zval_ptr);
+ switch (type) {
+ case BP_VAR_R:
+ zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ case BP_VAR_UNSET:
+ case BP_VAR_IS:
+ retval = &EG(uninitialized_zval_ptr);
+ break;
+ case BP_VAR_RW:
+ zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ case BP_VAR_W: {
+ zval *value;
+ ALLOC_INIT_ZVAL(value);
+ zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), (void **)&retval);
+ }
}
- } else {
- return retval;
}
- break;
+ return retval;
default:
zend_error(E_WARNING, "Illegal offset type");
- return &EG(uninitialized_zval_ptr);
+ return (type == BP_VAR_W || type == BP_VAR_RW) ?
+ &EG(error_zval_ptr) : &EG(uninitialized_zval_ptr);
}
} /* }}} */
@@ -519,11 +520,11 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
}
if (ht == &EG(symbol_table)) {
if (zend_delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
} else {
if (zend_symtable_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
} else {
spl_array_object *obj = intern;
@@ -569,7 +570,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
return;
}
if (zend_hash_index_del(ht, index) == FAILURE) {
- zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
}
break;
default:
@@ -713,7 +714,6 @@ SPL_METHOD(Array, offsetSet)
spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC);
} /* }}} */
-
void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index e5dc030730..098d7dc1e2 100755
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2820,7 +2820,7 @@ SPL_METHOD(CachingIterator, offsetGet)
}
if (zend_symtable_find(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1, (void**)&value) == FAILURE) {
- zend_error(E_NOTICE, "Undefined index: %s", arKey);
+ zend_error(E_NOTICE, "Undefined index: %s", arKey);
return;
}
diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt
new file mode 100644
index 0000000000..f0b2b0182c
--- /dev/null
+++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt
@@ -0,0 +1,50 @@
+--TEST--
+RecursiveDirectoryIterator::getBasePath() - basic test
+--CREDITS--
+Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+$depth0 = "depth0";
+$depth1 = 'depth1';
+$depth2 = 'depth2';
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2;
+mkdir($targetDir, 0777, true);
+touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPath_test.tmp');
+$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0);
+$it = new RecursiveIteratorIterator($iterator);
+
+$list = [];
+while($it->valid()) {
+ $list[] = $it->getSubPath();
+ $it->next();
+}
+asort($list);
+foreach ($list as $item) {
+ echo $item . "\n";
+}
+?>
+--CLEAN--
+<?php
+function rrmdir($dir) {
+ foreach(glob($dir . '/*') as $file) {
+ if(is_dir($file)) {
+ rrmdir($file);
+ } else {
+ unlink($file);
+ }
+ }
+
+ rmdir($dir);
+}
+
+$targetDir = __DIR__.DIRECTORY_SEPARATOR . "depth0";
+rrmdir($targetDir);
+?>
+
+--EXPECTF--
+depth1
+depth1
+depth1%cdepth2
+depth1%cdepth2
+depth1%cdepth2
diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt
new file mode 100644
index 0000000000..7b12672e14
--- /dev/null
+++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt
@@ -0,0 +1,56 @@
+--TEST--
+RecursiveDirectoryIterator::getBasePathname() - basic test
+--CREDITS--
+Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+$depth0 = "depth0";
+$depth1 = "depth1";
+$depth2 = "depth2";
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2;
+mkdir($targetDir, 0777, true);
+touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPathname_test_2.tmp');
+touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . 'getSubPathname_test_3.tmp');
+touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . 'getSubPathname_test_1.tmp');
+$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0);
+$it = new RecursiveIteratorIterator($iterator);
+
+$list = [];
+$it->rewind(); //see https://bugs.php.net/bug.php?id=62914
+while($it->valid()) {
+ $list[] = $it->getSubPathname();
+ $it->next();
+}
+asort($list);
+foreach ($list as $item) {
+ echo $item . "\n";
+}
+?>
+--CLEAN--
+<?php
+function rrmdir($dir) {
+ foreach(glob($dir . '/*') as $file) {
+ if(is_dir($file)) {
+ rrmdir($file);
+ } else {
+ unlink($file);
+ }
+ }
+
+ rmdir($dir);
+}
+
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . "depth0";
+rrmdir($targetDir);
+?>
+--EXPECTF--
+.
+..
+depth1%c.
+depth1%c..
+depth1%cdepth2%c.
+depth1%cdepth2%c..
+depth1%cdepth2%cgetSubPathname_test_2.tmp
+depth1%cgetSubPathname_test_3.tmp
+getSubPathname_test_1.tmp
diff --git a/ext/spl/tests/arrayObject___construct_basic2.phpt b/ext/spl/tests/arrayObject___construct_basic2.phpt
index 9ff0e4257a..bd27c42774 100644
--- a/ext/spl/tests/arrayObject___construct_basic2.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic2.phpt
@@ -63,7 +63,7 @@ bool(true)
Notice: Undefined property: ArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,7 +91,7 @@ bool(true)
Notice: Undefined property: MyArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic3.phpt b/ext/spl/tests/arrayObject___construct_basic3.phpt
index 1abd1a1ab1..11a17a6dc4 100644
--- a/ext/spl/tests/arrayObject___construct_basic3.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic3.phpt
@@ -63,7 +63,7 @@ bool(true)
Notice: Undefined property: ArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,7 +91,7 @@ bool(true)
Notice: Undefined property: MyArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic4.phpt b/ext/spl/tests/arrayObject___construct_basic4.phpt
index 80f5e0861e..b0809de0d4 100644
--- a/ext/spl/tests/arrayObject___construct_basic4.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic4.phpt
@@ -61,11 +61,11 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 39
+Notice: Undefined index: prop in %s on line 39
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,9 +91,9 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic5.phpt b/ext/spl/tests/arrayObject___construct_basic5.phpt
index 5368d250a1..8c44ee2ce4 100644
--- a/ext/spl/tests/arrayObject___construct_basic5.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic5.phpt
@@ -61,11 +61,11 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 39
+Notice: Undefined index: prop in %s on line 39
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,9 +91,9 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject_magicMethods1.phpt b/ext/spl/tests/arrayObject_magicMethods1.phpt
index b1de4a951e..ec4812f107 100644
--- a/ext/spl/tests/arrayObject_magicMethods1.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods1.phpt
@@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 42
+Notice: Undefined index: nonexistent in %s on line 42
NULL
string(11) "new.changed"
Original wrapped object:
@@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 60
+Notice: Undefined index: nonexistent in %s on line 60
Original wrapped object:
object(UsesMagic)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods3.phpt b/ext/spl/tests/arrayObject_magicMethods3.phpt
index 16a6a3b80c..6231ceabb7 100644
--- a/ext/spl/tests/arrayObject_magicMethods3.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods3.phpt
@@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 42
+Notice: Undefined index: nonexistent in %s on line 42
NULL
string(11) "new.changed"
Original wrapped object:
@@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 60
+Notice: Undefined index: nonexistent in %s on line 60
Original wrapped object:
object(UsesMagic)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods4.phpt b/ext/spl/tests/arrayObject_magicMethods4.phpt
index 3c9f78781a..9580dc5ae7 100644
--- a/ext/spl/tests/arrayObject_magicMethods4.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods4.phpt
@@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 45
+Notice: Undefined index: nonexistent in %s on line 45
NULL
string(11) "new.changed"
Original wrapped object:
@@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 63
+Notice: Undefined index: nonexistent in %s on line 63
Original wrapped object:
object(C)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods6.phpt b/ext/spl/tests/arrayObject_magicMethods6.phpt
index 45a0e4a768..b43f56c2b0 100644
--- a/ext/spl/tests/arrayObject_magicMethods6.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods6.phpt
@@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 45
+Notice: Undefined index: nonexistent in %s on line 45
NULL
string(11) "new.changed"
Original wrapped object:
@@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 63
+Notice: Undefined index: nonexistent in %s on line 63
Original wrapped object:
object(C)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_setFlags_basic1.phpt b/ext/spl/tests/arrayObject_setFlags_basic1.phpt
index d8d4f2e96d..391b0eeae7 100644
--- a/ext/spl/tests/arrayObject_setFlags_basic1.phpt
+++ b/ext/spl/tests/arrayObject_setFlags_basic1.phpt
@@ -44,8 +44,8 @@ string(21) "array element.changed"
--> Remove the array element and try access again:
bool(false)
-Notice: Undefined index: p in %s on line 10
+Notice: Undefined index: p in %s on line 10
NULL
-Notice: Undefined index: p in %s on line 12
+Notice: Undefined index: p in %s on line 12
string(8) ".changed"
diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt
index d9fb57c4ce..b55fcba1fd 100755
--- a/ext/spl/tests/array_001.phpt
+++ b/ext/spl/tests/array_001.phpt
@@ -79,15 +79,15 @@ object(ArrayObject)#%d (1) {
}
int(0)
-Notice: Undefined offset: 6 in %sarray_001.php on line %d
+Notice: Undefined offset: 6 in %sarray_001.php on line %d
NULL
-Notice: Undefined index: b in %sarray_001.php on line %d
+Notice: Undefined index: b in %sarray_001.php on line %d
NULL
-Notice: Undefined offset: 7 in %sarray_001.php on line %d
+Notice: Undefined offset: 7 in %sarray_001.php on line %d
-Notice: Undefined index: c in %sarray_001.php on line %d
+Notice: Undefined index: c in %sarray_001.php on line %d
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/array_010.phpt
index 6b331e4b51..d2f3de7f6d 100755
--- a/ext/spl/tests/array_010.phpt
+++ b/ext/spl/tests/array_010.phpt
@@ -94,10 +94,10 @@ int(1)
string(3) "3rd"
int(4)
-Notice: Undefined index: 5th in %sarray_010.php on line %d
+Notice: Undefined index: 5th in %sarray_010.php on line %d
NULL
-Notice: Undefined offset: 6 in %sarray_010.php on line %d
+Notice: Undefined offset: 6 in %sarray_010.php on line %d
NULL
===offsetSet===
WRITE 1
@@ -128,9 +128,9 @@ array(6) {
string(9) "changed 6"
}
-Notice: Undefined offset: 7 in %sarray_010.php on line %d
+Notice: Undefined offset: 7 in %sarray_010.php on line %d
-Notice: Undefined index: 8th in %sarray_010.php on line %d
+Notice: Undefined index: 8th in %sarray_010.php on line %d
array(4) {
[0]=>
string(3) "1st"
diff --git a/ext/spl/tests/bug45622.phpt b/ext/spl/tests/bug45622.phpt
index c47b62cbdf..a8fe2c4641 100644
--- a/ext/spl/tests/bug45622.phpt
+++ b/ext/spl/tests/bug45622.phpt
@@ -42,7 +42,7 @@ bool(true)
--> Remove the array element and try access again:
bool(false)
-Notice: Undefined index: p in %s on line %d
+Notice: Undefined index: p in %s on line %d
NULL
--> Re-add the real property:
diff --git a/ext/spl/tests/bug45622b.phpt b/ext/spl/tests/bug45622b.phpt
index 9d49392111..f101a8459d 100644
--- a/ext/spl/tests/bug45622b.phpt
+++ b/ext/spl/tests/bug45622b.phpt
@@ -25,9 +25,9 @@ isset($ao->prop4);
--EXPECTF--
Doesn't trigger __get.
-Notice: Undefined index: prop1 in %s on line 11
+Notice: Undefined index: prop1 in %s on line 11
Doesn't trigger __set.
Doesn't trigger __unset.
-Notice: Undefined index: prop3 in %s on line 17
+Notice: Undefined index: prop3 in %s on line 17
Shouldn't trigger __isset. \ No newline at end of file
diff --git a/ext/spl/tests/bug54323.phpt b/ext/spl/tests/bug54323.phpt
index 35a16a4637..df6416a0f1 100644
--- a/ext/spl/tests/bug54323.phpt
+++ b/ext/spl/tests/bug54323.phpt
@@ -19,6 +19,6 @@ function testAccess($c, $ao) {
--EXPECTF--
Notice: Undefined property: C::$prop in %sbug54323.php on line 14
-Notice: Undefined index: prop in %sbug54323.php on line 14
+Notice: Undefined index: prop in %sbug54323.php on line 14
NULL
NULL
diff --git a/ext/spl/tests/bug62978.phpt b/ext/spl/tests/bug62978.phpt
new file mode 100644
index 0000000000..0d91609f88
--- /dev/null
+++ b/ext/spl/tests/bug62978.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables)
+--FILE--
+<?php
+$a = new ArrayObject();
+
+$b = array();
+
+$a[null]['hurr'] = 'durr';
+
+var_dump($a['epic_magic']);
+var_dump($b['epic_magic']);
+var_dump($c['epic_magic']); // Undefined var!!
+
+$d = array();
+var_dump($a['epic_magic']); // more magic!
+var_dump($d['epic_magic']);
+
+$e = 'srsly?';
+var_dump($a['epic_magic']); // srsly.
+var_dump(isset($a['epic_magic']));
+
+$fp = fopen(__FILE__, 'r');
+var_dump($a[$fp]);
+
+fclose($fp);
+--EXPECTF--
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined variable: c in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+bool(false)
+
+Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %sbug62978.php on line %d
+
+Notice: Undefined offset: %d in %sbug62978.php on line %d
+NULL
diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt
index 6d25531175..1271ccaa64 100755
--- a/ext/spl/tests/iterator_044.phpt
+++ b/ext/spl/tests/iterator_044.phpt
@@ -81,7 +81,7 @@ NULL
int(0)
bool(false)
-Notice: Undefined index: 0 in %siterator_044.php on line %d
+Notice: Undefined index: 0 in %siterator_044.php on line %d
NULL
===1===
object(stdClass)#%d (0) {
@@ -97,31 +97,31 @@ object(MyFoo)#%d (0) {
}
bool(false)
-Notice: Undefined index: foo in %siterator_044.php on line %d
+Notice: Undefined index: foo in %siterator_044.php on line %d
NULL
===3===
NULL
bool(false)
-Notice: Undefined index: in %siterator_044.php on line %d
+Notice: Undefined index: in %siterator_044.php on line %d
NULL
===4===
int(2)
bool(false)
-Notice: Undefined index: 2 in %siterator_044.php on line %d
+Notice: Undefined index: 2 in %siterator_044.php on line %d
NULL
===5===
string(3) "foo"
bool(false)
-Notice: Undefined index: foo in %siterator_044.php on line %d
+Notice: Undefined index: foo in %siterator_044.php on line %d
NULL
===6===
int(3)
bool(false)
-Notice: Undefined index: 3 in %siterator_044.php on line %d
+Notice: Undefined index: 3 in %siterator_044.php on line %d
NULL
===FILL===
===0===
@@ -146,7 +146,7 @@ int(1)
NULL
bool(false)
-Notice: Undefined index: in %siterator_044.php on line %d
+Notice: Undefined index: in %siterator_044.php on line %d
NULL
===4===
int(2)
@@ -160,6 +160,6 @@ int(1)
int(3)
bool(false)
-Notice: Undefined index: 3 in %siterator_044.php on line %d
+Notice: Undefined index: 3 in %siterator_044.php on line %d
NULL
===DONE===
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index a2c50d5cb6..15fbefd51c 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -136,20 +136,20 @@ PHP_MINFO_FUNCTION(assert) /* {{{ */
}
/* }}} */
-/* {{{ proto int assert(string|bool assertion)
+/* {{{ proto int assert(string|bool assertion[, string description])
Checks if assertion is false */
PHP_FUNCTION(assert)
{
zval **assertion;
- int val;
+ int val, description_len = 0;
char *myeval = NULL;
- char *compiled_string_description;
+ char *compiled_string_description, *description = NULL;
if (! ASSERTG(active)) {
RETURN_TRUE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &assertion) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s", &assertion, &description, &description_len) == FAILURE) {
return;
}
@@ -167,7 +167,11 @@ PHP_FUNCTION(assert)
compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
if (zend_eval_stringl(myeval, Z_STRLEN_PP(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ if (description_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
+ }
if (ASSERTG(bail)) {
zend_bailout();
}
@@ -196,7 +200,7 @@ PHP_FUNCTION(assert)
}
if (ASSERTG(callback)) {
- zval *args[3];
+ zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0);
zval *retval;
int i;
uint lineno = zend_get_executed_lineno(TSRMLS_C);
@@ -214,19 +218,38 @@ PHP_FUNCTION(assert)
ZVAL_FALSE(retval);
/* XXX do we want to check for error here? */
- call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC);
+ if (description_len == 0) {
+ call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC);
+ for (i = 0; i <= 2; i++) {
+ zval_ptr_dtor(&(args[i]));
+ }
+ } else {
+ MAKE_STD_ZVAL(args[3]);
+ ZVAL_STRINGL(args[3], SAFE_STRING(description), description_len, 1);
- for (i = 0; i <= 2; i++) {
- zval_ptr_dtor(&(args[i]));
+ call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 4, args TSRMLS_CC);
+ for (i = 0; i <= 3; i++) {
+ zval_ptr_dtor(&(args[i]));
+ }
}
+
+ efree(args);
zval_ptr_dtor(&retval);
}
if (ASSERTG(warning)) {
- if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ if (description_len == 0) {
+ if (myeval) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ }
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ if (myeval) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description);
+ }
}
}
@@ -321,3 +344,4 @@ PHP_FUNCTION(assert_options)
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
+
diff --git a/ext/standard/tests/assert/assert04.phpt b/ext/standard/tests/assert/assert04.phpt
index 0da23186e6..bffadcb97c 100644
--- a/ext/standard/tests/assert/assert04.phpt
+++ b/ext/standard/tests/assert/assert04.phpt
@@ -15,7 +15,7 @@ assert(1);
/* Wrong parameter count in assert */
assert_options(ASSERT_ACTIVE, 1);
-assert(2,3);
+assert(2, "failure", 3);
/* Wrong parameter count in assert_options */
assert_options(ASSERT_ACTIVE, 0, 2);
@@ -36,7 +36,7 @@ echo "not reached\n";
?>
--EXPECTF--
-Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d
+Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
@@ -45,3 +45,4 @@ Warning: assert_options() expects parameter 1 to be long, %unicode_string_option
Warning: assert(): Assertion failed in %s on line %d
Warning: assert(): Assertion failed in %s on line %d
+
diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt
new file mode 100644
index 0000000000..2a73713437
--- /dev/null
+++ b/ext/standard/tests/assert/assert_basic6.phpt
@@ -0,0 +1,26 @@
+--TEST--
+assert() - basic - Test that bailout works
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 1
+assert.bail = 0
+--FILE--
+<?php
+function f1($message)
+{
+ echo "f1 called\n";
+}
+
+//bail out on error
+var_dump($rao = assert_options(ASSERT_BAIL, 1));
+$sa = "0 != 0";
+var_dump($r2 = assert($sa, "0 is 0"));
+echo "If this is printed BAIL hasn't worked";
+--EXPECTF--
+int(0)
+f1 called
+
+Warning: assert(): 0 is 0: "0 != 0" failed in %s on line 10
+
diff --git a/ext/standard/tests/assert/assert_error1.phpt b/ext/standard/tests/assert/assert_error1.phpt
index 6211f1c918..657b411f67 100644
--- a/ext/standard/tests/assert/assert_error1.phpt
+++ b/ext/standard/tests/assert/assert_error1.phpt
@@ -20,19 +20,19 @@ function handler($errno, $errstr) {
//Wrong number of parameters for assert_options()
assert_options(ASSERT_WARNING, 1);
-var_dump($rao=assert_options(ASSERT_CALLBACK,"f1",1));
+var_dump($rao = assert_options(ASSERT_CALLBACK, "f1", 1));
//Unknown option for assert_options()
-var_dump($rao=assert_options("F1","f1"));
+var_dump($rao=assert_options("F1", "f1"));
//Wrong number of parameters for assert()
$sa="0 != 0";
-var_dump($r2=assert($sa,1));
+var_dump($r2 = assert($sa, "message", 1));
//Catch recoverable error with handler
-var_dump($rc=assert('aa=sd+as+safsafasfaçsafçsafç'));
+var_dump($rc = assert('aa=sd+as+safsafasfaçsafçsafç'));
--EXPECTF--
Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
NULL
@@ -40,5 +40,6 @@ NULL
Warning: assert_options() expects parameter 1 to be long, string given in %s on line %d
NULL
-Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d
+Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
NULL
+
diff --git a/ext/standard/tests/assert/assert_error2.phpt b/ext/standard/tests/assert/assert_error2.phpt
new file mode 100644
index 0000000000..da7c3d9e0b
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+assert() - basic - Test that bailout works
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 1
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+function f1($script, $line, $message, $user_message)
+{
+ echo "f1 called\n";
+}
+
+//bail out on error
+var_dump($rao = assert_options(ASSERT_BAIL, 1));
+$sa = "0 != 0";
+var_dump($r2 = assert($sa));
+echo "If this is printed BAIL hasn't worked";
+--EXPECTF--
+int(0)
+
+Warning: Missing argument 4 for f1() in %s on line 2
+f1 called
+
+Warning: assert(): Assertion "0 != 0" failed in %s on line 10
+
diff --git a/ext/standard/tests/assert/assert_error3.phpt b/ext/standard/tests/assert/assert_error3.phpt
new file mode 100644
index 0000000000..54b91edd3d
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error3.phpt
@@ -0,0 +1,21 @@
+--TEST--
+assert() - basic - Test recoverable error
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 0
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+$sa = "0 $ 0";
+var_dump($r2 = assert($sa));
+--EXPECTF--
+
+Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1
+
+Catchable fatal error: assert(): Failure evaluating code:
+0 $ 0 in %s on line 3
+
diff --git a/ext/standard/tests/assert/assert_error4.phpt b/ext/standard/tests/assert/assert_error4.phpt
new file mode 100644
index 0000000000..264cc8fecf
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error4.phpt
@@ -0,0 +1,21 @@
+--TEST--
+assert() - basic - Test recoverable error
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 0
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+$sa = "0 $ 0";
+var_dump($r2 = assert($sa, "Describing what was asserted"));
+--EXPECTF--
+
+Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1
+
+Catchable fatal error: assert(): Failure evaluating code:
+Describing what was asserted:"0 $ 0" in %s on line 3
+
diff --git a/ext/standard/tests/general_functions/bug60723.phpt b/ext/standard/tests/general_functions/bug60723.phpt
new file mode 100644
index 0000000000..07b801bcfe
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug60723.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #60723 (error_log error time has changed to UTC ignoring default timezo)
+--INI--
+date.timezone=ASIA/Chongqing
+log_errors=On
+--FILE--
+<?php
+$dir = dirname(__FILE__);
+$log = $dir . "/tmp.err";
+ini_set("error_log", $log);
+echo $aa;
+error_log("dummy");
+readfile($log);
+unlink($log);
+?>
+--EXPECTF--
+Notice: Undefined variable: aa in %sbug60723.php on line %d
+[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d
+[%s ASIA/Chongqing] dummy
diff --git a/ext/standard/tests/network/gethostbyname_basic001.phpt b/ext/standard/tests/network/gethostbyname_basic001.phpt
index e917b59920..9171e226aa 100644
--- a/ext/standard/tests/network/gethostbyname_basic001.phpt
+++ b/ext/standard/tests/network/gethostbyname_basic001.phpt
@@ -5,6 +5,7 @@ gethostbyname() function - basic type return test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
?>
--FILE--
<?php
diff --git a/ext/standard/tests/network/gethostbyname_basic002.phpt b/ext/standard/tests/network/gethostbyname_basic002.phpt
deleted file mode 100644
index 983faa929e..0000000000
--- a/ext/standard/tests/network/gethostbyname_basic002.phpt
+++ /dev/null
@@ -1,15 +0,0 @@
---TEST--
-gethostbyname() function - basic invalid parameter test
---CREDITS--
-"Sylvain R." <sracine@phpquebec.org>
---SKIPIF--
-<?php
-if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
-?>
---FILE--
-<?php
- $ip = gethostbyname("www.php.net");
- var_dump((bool) ip2long($ip));
-?>
---EXPECT--
-bool(true)
diff --git a/ext/standard/tests/network/gethostbyname_error004.phpt b/ext/standard/tests/network/gethostbyname_error004.phpt
index 7aac172920..274301a236 100644
--- a/ext/standard/tests/network/gethostbyname_error004.phpt
+++ b/ext/standard/tests/network/gethostbyname_error004.phpt
@@ -5,6 +5,7 @@ gethostbyname() function - basic return valid ip address test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
?>
--FILE--
<?php
diff --git a/ext/standard/tests/network/getmxrr.phpt b/ext/standard/tests/network/getmxrr.phpt
index 29cea1d71e..c4a15c52ce 100644
--- a/ext/standard/tests/network/getmxrr.phpt
+++ b/ext/standard/tests/network/getmxrr.phpt
@@ -3,6 +3,7 @@ getmxrr() test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip: no Windows support');
}
diff --git a/ext/standard/tests/serialize/bug35895.phpt b/ext/standard/tests/serialize/bug35895.phpt
new file mode 100644
index 0000000000..22fce0d1f2
--- /dev/null
+++ b/ext/standard/tests/serialize/bug35895.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #35895 (__sleep and private property)
+--FILE--
+<?php
+class Parents {
+ private $parents;
+ public function __sleep() {
+ return array("parents");
+ }
+}
+
+class Child extends Parents {
+ private $child;
+ public function __sleep() {
+ return array_merge(array("child"), parent::__sleep());
+ }
+}
+
+$obj = new Child();
+serialize($obj);
+
+?>
+--EXPECTF--
+Notice: serialize(): "parents" returned as member variable from __sleep() but does not exist in %sbug35895.php on line %d
diff --git a/ext/standard/tests/strings/http_build_query_error.phpt b/ext/standard/tests/strings/http_build_query_error.phpt
new file mode 100644
index 0000000000..30155e62a3
--- /dev/null
+++ b/ext/standard/tests/strings/http_build_query_error.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing error on null parameter 1 of http_build_query()
+--CREDITS--
+Pawel Krynicki <pawel.krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+
+$result = http_build_query(null);
+
+?>
+--EXPECTF--
+Warning: http_build_query(): Parameter 1 expected to be Array or Object. %s value given in %s on line %d \ No newline at end of file
diff --git a/ext/standard/tests/url/bug63162.phpt b/ext/standard/tests/url/bug63162.phpt
new file mode 100644
index 0000000000..ea5205efd6
--- /dev/null
+++ b/ext/standard/tests/url/bug63162.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Test parse_url() for bug #63162
+--DESCRIPTION--
+This test covers tests the inputs:
+[0]=> http://user:pass@host
+[1]=> //user:pass@host
+[2]=> //user@host
+--FILE--
+<?php
+var_dump(parse_url('http://user:pass@host'));
+var_dump(parse_url('//user:pass@host'));
+var_dump(parse_url('//user@host'));
+?>
+--EXPECT--
+array(4) {
+ ["scheme"]=>
+ string(4) "http"
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(4) "pass"
+}
+array(3) {
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(4) "pass"
+}
+array(2) {
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+}
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 44a568032b..c159322837 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -201,6 +201,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
STR_FREE(ret->scheme);
efree(ret);
return NULL;
+ } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
+ s += 2;
} else {
goto just_path;
}
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index d883d4dfa3..1ec269de30 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -2,9 +2,9 @@
#line 1 "ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 6 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index e7218a14f1..2e37cf0ba4 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 6 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 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 |
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 494fb583c7..a4fa262e76 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -639,6 +639,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
HashPosition pos;
int i;
zval nval, *nvalp;
+ HashTable *propers;
ZVAL_NULL(&nval);
nvalp = &nval;
@@ -664,7 +665,8 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
smart_str_appendl(buf,"N;", 2);
continue;
}
- if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) {
+ propers = Z_OBJPROP_P(struc);
+ if (zend_hash_find(propers, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name));
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
} else {
@@ -676,7 +678,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
do {
zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
+ if (zend_hash_find(propers, priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, priv_name, prop_name_length);
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
@@ -684,7 +686,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
+ if (zend_hash_find(propers, prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, prot_name, prop_name_length);
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
diff --git a/ext/zlib/tests/bug55544-win.phpt b/ext/zlib/tests/bug55544-win.phpt
new file mode 100644
index 0000000000..03fd6b1c90
--- /dev/null
+++ b/ext/zlib/tests/bug55544-win.phpt
Binary files differ
diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt
index ca4214a46f..a0d22f4fce 100644
--- a/ext/zlib/tests/bug55544.phpt
+++ b/ext/zlib/tests/bug55544.phpt
Binary files differ
diff --git a/ext/zlib/tests/bug_52944-darwin.phpt b/ext/zlib/tests/bug_52944-darwin.phpt
new file mode 100644
index 0000000000..c25babadf5
--- /dev/null
+++ b/ext/zlib/tests/bug_52944-darwin.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (PHP_OS != 'Darwin') {
+ die("skip Darwin only");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(1) "%"
+string(1) "C"
+Done.
diff --git a/ext/zlib/tests/bug_52944-win.phpt b/ext/zlib/tests/bug_52944-win.phpt
new file mode 100644
index 0000000000..fa369f8fb4
--- /dev/null
+++ b/ext/zlib/tests/bug_52944-win.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die("skip windows only");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(1) "%"
+string(1) "C"
+Done.
diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt
index c090fe6f5c..ed4af3e157 100644
--- a/ext/zlib/tests/bug_52944.phpt
+++ b/ext/zlib/tests/bug_52944.phpt
@@ -1,162 +1,27 @@
---TEST--
-Bug #52944 (segfault with zlib filter and corrupted data)
---SKIPIF--
-<?php if (!extension_loaded("zlib")) print "skip"; ?>
-<?php
-include "func.inc";
-if (substr(PHP_OS, 0, 3) == 'WIN' && version_compare(get_zlib_version(), '1.2.7') < 0) {
- die('skip - only for zlib >= 1.2.7 on windows');
-}
---INI--
-allow_url_fopen=1
---FILE--
-<?php
-$data =
-'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'.
-'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'.
-'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'.
-'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'.
-'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'.
-'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'.
-'N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77/cPzunglxyZYJCVwd4d7f60ebKj0CgOr1x/WoY83v1zHuExKIsy2HaG'.
-'TYzAEcpP7KI50Gsq9HYlWElmoIipaMzO0e7htiqNp6MKsP0dcL+3c3wx1TjevaLZOSGAbDnAY2+q6HNSpE9VU7YO3x+cHH1UlSCg'.
-'i6e/udG7B1uHWVcD2O4QdE4F4Kv3H4/zFXQrOWd7r8Dp231VBh1+OEC7syjEtoWirADNCWcA3UutRaEXjk9guJYE7RHPA1VVEI9K'.
-'rSg7qOo/suXUVo/B4kiq6Pj6MFc+nog5D1/90SOqIc45zS20XmOwTW+S3Ae1RlBvaQ5hPtQ6QW0Jc6I/1eKHSn+uVlLzprQnvwy+'.
-'uXWye3igcjgf4FQCPNpXB3eKujy0918dwuPh+3evPqqKO44mI6hGCfTVx+1NhTUBtOVOkwqwDzs7P6pdeR0EF1Vw+8Aeb48zuEE0'.
-'HHcF4NbbzaMTAVnidDQupcVXAV+SL6T3QKmGUnKo0PeNtyJcJmYknHYV9Seyu/KVBlbND09w2LMhX0KdQqeo54GTt5PCp67OPPD1'.
-'2naefOs1Les5FbK+XyA09UgFgY929nNwozi4CqMJOO7VGZ4XEXfdfntlCl50GXbtYwF2TUNAWV0m7u7xu73Nj+cgy/ePC/0M4nyg'.
-'GM7bO3sFES37I8ABKizJzVcABuLq9S546WoW5LY40KbRBFwY8XDtDsfo7bcIA3ohibCLN6rQCcH5RSjFpLqWpD7+XLRgO23tnMvZ'.
-'BcR9H+IJq3fiESmZWBbnilDlCKPe2X5QJA==';
-$fp = fopen('data://text/plain;base64,' . $data, 'r');
-stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
-var_dump(fread($fp,1));
-var_dump(fread($fp,1));
-fclose($fp);
-echo "Done.\n";
---EXPECT--
-string(0) ""
-string(0) ""
-Done.
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die("skip not for windows");
+}
+if (PHP_OS == 'Darwin') {
+ die("skip not for Darwin");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(0) ""
+string(0) ""
+Done.
diff --git a/ext/zlib/tests/bug_52944_corrupted_data.inc b/ext/zlib/tests/bug_52944_corrupted_data.inc
new file mode 100644
index 0000000000..ed46a36a1f
--- /dev/null
+++ b/ext/zlib/tests/bug_52944_corrupted_data.inc
@@ -0,0 +1,142 @@
+<?php
+
+// corrupted data
+$data =
+'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'.
+'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'.
+'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'.
+'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'.
+'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'.
+'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'.
+'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