summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-04-20 20:39:29 +0200
committerAnatol Belski <ab@php.net>2014-04-20 20:39:29 +0200
commit7c6ac6be55194a68aa140686d28a8baeca49c79a (patch)
tree60352f9f5c07646b00da4bd957c93da7c103a305
parentc0faf60be0419f8d18a4298cf14b72a09dbe108e (diff)
parent3eaf40c3fcc264e751440c3d3d2374e3e33874c4 (diff)
downloadphp-git-7c6ac6be55194a68aa140686d28a8baeca49c79a.tar.gz
Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (23 commits) updated libs versions added some notes about the win build system UPGRADING note about bug #67072 UPGRADING note about bug #67072 UPGRADING note about bug #67072 refixed the test related to bug #67072 Improved the fix for bug #67072, thanks Nikita Fixed test case for 5328d42 These links to ~helly don't work anymore. updated NEWS updated NEWS Fixed bug #67072 Echoing unserialized "SplFileObject" crash updated UPGRADING updated UPGRADING correct the bug #67081 fix updated NEWS updated NEWS Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset updated NEWS Fixed bug #67079 Missing MIME types for XML/XSL files ...
-rw-r--r--Zend/tests/generators/errors/serialize_unserialize_error.phpt9
-rw-r--r--ext/dom/documenttype.c36
-rw-r--r--ext/dom/tests/DOMDocumentType_basic_001.phpt4
-rw-r--r--ext/dom/tests/bug67081.phpt43
-rw-r--r--ext/dom/tests/bug67081_0.xml6
-rw-r--r--ext/dom/tests/bug67081_1.xml7
-rw-r--r--ext/dom/tests/bug67081_2.xml5
-rw-r--r--ext/fileinfo/config.m435
-rw-r--r--ext/fileinfo/libmagic/strcasestr.c82
-rwxr-xr-xext/spl/README2
-rwxr-xr-xext/spl/spl.php3
-rw-r--r--ext/standard/tests/serialize/005.phpt8
-rw-r--r--ext/standard/tests/serialize/bug67072.phpt12
-rw-r--r--ext/standard/var_unserializer.c78
-rw-r--r--ext/standard/var_unserializer.re14
-rw-r--r--sapi/cli/php_cli_server.c3
-rw-r--r--win32/build/libs_version.txt2
17 files changed, 289 insertions, 60 deletions
diff --git a/Zend/tests/generators/errors/serialize_unserialize_error.phpt b/Zend/tests/generators/errors/serialize_unserialize_error.phpt
index aa2d4693f7..b5e77e5028 100644
--- a/Zend/tests/generators/errors/serialize_unserialize_error.phpt
+++ b/Zend/tests/generators/errors/serialize_unserialize_error.phpt
@@ -32,12 +32,11 @@ Stack trace:
#0 %s(%d): serialize(Object(Generator))
#1 {main}
-exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
-Stack trace:
-#0 [internal function]: Generator->__wakeup()
-#1 %s(%d): unserialize('O:9:"Generator"...')
-#2 {main}
+Warning: Erroneous data format for unserializing 'Generator' in %sserialize_unserialize_error.php on line %d
+
+Notice: unserialize(): Error at offset 19 of 20 bytes in %sserialize_unserialize_error.php on line %s
+bool(false)
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
Stack trace:
#0 %s(%d): unserialize('C:9:"Generator"...')
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index a94cc31d74..9042457e86 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -188,8 +188,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
{
xmlDtdPtr dtdptr;
- xmlDtd *intsubset;
- xmlOutputBuffer *buff = NULL;
+ xmlDtdPtr intsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -200,22 +199,37 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
ALLOC_ZVAL(*retval);
- if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) {
- buff = xmlAllocOutputBuffer(NULL);
- if (buff != NULL) {
- xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
- xmlOutputBufferFlush(buff);
+ if (dtdptr->doc != NULL && ((intsubset = xmlGetIntSubset(dtdptr->doc)) != NULL) && intsubset->children != NULL) {
+ smart_str ret_buf = {0};
+ xmlNodePtr cur = intsubset->children;
+
+ while (cur != NULL) {
+ xmlOutputBuffer *buff = xmlAllocOutputBuffer(NULL);
+
+ if (buff != NULL) {
+ xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL);
+ xmlOutputBufferFlush(buff);
+
#ifdef LIBXML2_NEW_BUFFER
- ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
+ smart_str_appendl(&ret_buf, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff));
#else
- ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
+ smart_str_appendl(&ret_buf, buff->buffer->content, buff->buffer->use);
#endif
- (void)xmlOutputBufferClose(buff);
+
+ (void)xmlOutputBufferClose(buff);
+ }
+
+ cur = cur->next;
+ }
+
+ if (ret_buf.len) {
+ ZVAL_STRINGL(*retval, ret_buf.c, ret_buf.len, 1);
+ smart_str_free(&ret_buf);
return SUCCESS;
}
}
- ZVAL_EMPTY_STRING(*retval);
+ ZVAL_NULL(*retval);
return SUCCESS;
diff --git a/ext/dom/tests/DOMDocumentType_basic_001.phpt b/ext/dom/tests/DOMDocumentType_basic_001.phpt
index 8991ed97d4..6648a146ff 100644
--- a/ext/dom/tests/DOMDocumentType_basic_001.phpt
+++ b/ext/dom/tests/DOMDocumentType_basic_001.phpt
@@ -43,6 +43,6 @@ print 'notation: '.$notation->nodeName."\n";
publicId: -//OASIS//DTD DocBook XML//EN
systemId: docbookx.dtd
name: chapter
-internalSubset: <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML//EN" "docbookx.dtd">
+internalSubset:
entity: logo
-notation: gif \ No newline at end of file
+notation: gif
diff --git a/ext/dom/tests/bug67081.phpt b/ext/dom/tests/bug67081.phpt
new file mode 100644
index 0000000000..56c2c8e58b
--- /dev/null
+++ b/ext/dom/tests/bug67081.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+?>
+--FILE--
+<?php
+ $domDocument = new DOMDocument();
+ $domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_0.xml");
+ var_dump($domDocument->doctype->internalSubset);
+
+ $domDocument = new DOMDocument();
+ $domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_1.xml");
+ var_dump($domDocument->doctype->internalSubset);
+
+ $domDocument = new DOMDocument();
+ $domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_2.xml");
+ var_dump($domDocument->doctype->internalSubset);
+
+ $domDocument = new DOMDocument();
+ $domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "dom.xml");
+ var_dump($domDocument->doctype->internalSubset);
+?>
+===DONE===
+--EXPECT--
+string(19) "<!ELEMENT a EMPTY>
+"
+string(38) "<!ELEMENT a EMPTY>
+<!ELEMENT b EMPTY>
+"
+NULL
+string(277) "<!ENTITY % incent SYSTEM "dom.ent">
+<!ENTITY amp "&#38;#38;">
+<!ENTITY gt "&#62;">
+<!ENTITY % coreattrs "title CDATA #IMPLIED">
+<!ENTITY % attrs "%coreattrs;">
+<!ATTLIST foo bar CDATA #IMPLIED>
+<!ELEMENT foo (#PCDATA)>
+<!ELEMENT root (foo)+>
+<!ATTLIST th title CDATA #IMPLIED>
+"
+===DONE===
diff --git a/ext/dom/tests/bug67081_0.xml b/ext/dom/tests/bug67081_0.xml
new file mode 100644
index 0000000000..604eea57b1
--- /dev/null
+++ b/ext/dom/tests/bug67081_0.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+ <!ELEMENT a EMPTY>
+]>
+<a></a>
+
diff --git a/ext/dom/tests/bug67081_1.xml b/ext/dom/tests/bug67081_1.xml
new file mode 100644
index 0000000000..7ae542e977
--- /dev/null
+++ b/ext/dom/tests/bug67081_1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE a [
+ <!ELEMENT a EMPTY>
+ <!ELEMENT b EMPTY>
+]>
+<a></a>
+
diff --git a/ext/dom/tests/bug67081_2.xml b/ext/dom/tests/bug67081_2.xml
new file mode 100644
index 0000000000..c10af0966c
--- /dev/null
+++ b/ext/dom/tests/bug67081_2.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<a></a>
+
diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
index 4f34041259..a11dbf8dac 100644
--- a/ext/fileinfo/config.m4
+++ b/ext/fileinfo/config.m4
@@ -13,6 +13,41 @@ if test "$PHP_FILEINFO" != "no"; then
libmagic/is_tar.c libmagic/magic.c libmagic/print.c \
libmagic/readcdf.c libmagic/readelf.c libmagic/softmagic.c"
+ AC_MSG_CHECKING([for strcasestr])
+ AC_TRY_RUN([
+#include <string.h>
+#include <strings.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ char *s0, *s1, *ret;
+
+ s0 = (char *) malloc(42);
+ s1 = (char *) malloc(8);
+
+ memset(s0, 'X', 42);
+ s0[24] = 'Y';
+ s0[26] = 'Z';
+ s0[41] = '\0';
+ memset(s1, 'x', 8);
+ s1[0] = 'y';
+ s1[2] = 'Z';
+ s1[7] = '\0';
+
+ ret = strcasestr(s0, s1);
+
+ return !(NULL != ret);
+}
+ ],[
+ dnl using the platform implementation
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ AC_MSG_NOTICE(using libmagic strcasestr implementation)
+ libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
+ ])
+
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
diff --git a/ext/fileinfo/libmagic/strcasestr.c b/ext/fileinfo/libmagic/strcasestr.c
new file mode 100644
index 0000000000..546ed3f96c
--- /dev/null
+++ b/ext/fileinfo/libmagic/strcasestr.c
@@ -0,0 +1,82 @@
+/* $NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: strcasestr.c,v 1.3 2005/11/29 03:12:00 christos Exp $");
+__RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <assert.h>
+#include <ctype.h>
+#include <string.h>
+
+static int
+_strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ if (n != 0) {
+ const unsigned char *us1 = (const unsigned char *)s1,
+ *us2 = (const unsigned char *)s2;
+
+ do {
+ if (tolower(*us1) != tolower(*us2++))
+ return tolower(*us1) - tolower(*--us2);
+ if (*us1++ == '\0')
+ break;
+ } while (--n != 0);
+ }
+ return 0;
+}
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+char *
+strcasestr(const char *s, const char *find)
+{
+ char c, sc;
+ size_t len;
+
+ if ((c = *find++) != 0) {
+ c = tolower((unsigned char)c);
+ len = strlen(find);
+ do {
+ do {
+ if ((sc = *s++) == 0)
+ return (NULL);
+ } while ((char)tolower((unsigned char)sc) != c);
+ } while (_strncasecmp(s, find, len) != 0);
+ s--;
+ }
+ return (char *)(intptr_t)(s);
+}
diff --git a/ext/spl/README b/ext/spl/README
index b2aeb596d0..28373a3eda 100755
--- a/ext/spl/README
+++ b/ext/spl/README
@@ -4,4 +4,4 @@ code in the file spl.php or in the corresponding .inc file in the examples
subdirectory. Based on the internal implementations or the files in the
examples subdirectory there are also some .php files to experiment with.
-For more information look at: http://php.net/~helly/php/ext/spl
+For more information look at: http://php.net/manual/en/book.spl.php
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index 3638a5a2b7..c276f1f2ee 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -145,9 +145,6 @@
* - Debug session 2 <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_1.pps">[pps]</a>, <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_1.pdf">[pdf]</a>, <a href="http://taks.somabo.de/200411_php_conference_frankfrurt_iterator_debug_session.swf">[swf]</a>
* - Debug session 3 <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_2.pps">[pps]</a>, <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_2.pdf">[pdf]</a>
*
- * You can download this documentation as a chm file
- * <a href="http://php.net/~helly/php/ext/spl/spl.chm">here</a>.
- *
* (c) Marcus Boerger, 2003 - 2007
*/
diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt
index e7b23db701..2df270154d 100644
--- a/ext/standard/tests/serialize/005.phpt
+++ b/ext/standard/tests/serialize/005.phpt
@@ -156,9 +156,11 @@ object(TestNAOld)#%d (0) {
}
===NANew===
unserializer(TestNANew)
-TestNew::__wakeup()
-object(TestNANew)#%d (0) {
-}
+
+Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d
+
+Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d
+bool(false)
===NANew2===
unserializer(TestNANew2)
TestNew::unserialize()
diff --git a/ext/standard/tests/serialize/bug67072.phpt b/ext/standard/tests/serialize/bug67072.phpt
new file mode 100644
index 0000000000..951db75a07
--- /dev/null
+++ b/ext/standard/tests/serialize/bug67072.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #67072 Echoing unserialized "SplFileObject" crash
+--FILE--
+<?php
+ echo unserialize('O:13:"SplFileObject":1:{s:9:"*filename";s:15:"/home/flag/flag";}');
+?>
+===DONE==
+--EXPECTF--
+Warning: Erroneous data format for unserializing 'SplFileObject' in %sbug67072.php on line %d
+
+Notice: unserialize(): Error at offset 24 of 64 bytes in %sbug67072.php on line %d
+===DONE==
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 8e75482feb..fe619b3ee5 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.5 on Fri Apr 18 15:07:27 2014 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2014 The PHP Group |
+ | Copyright (c) 1997-2013 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 |
@@ -396,7 +396,15 @@ static inline php_int_t object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *
(*p) += 2;
- object_init_ex(*rval, ce);
+ if (ce->serialize == NULL) {
+ object_init_ex(*rval, ce);
+ } else {
+ /* If this class implements Serializable, it should not land here but in object_custom(). The passed string
+ obviously doesn't descend from the regular serializer. */
+ zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ce->name);
+ return 0;
+ }
+
return elements;
}
@@ -408,6 +416,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, php_int_t elements)
zval *retval_ptr = NULL;
zval fname;
+ if (Z_TYPE_PP(rval) != IS_OBJECT) {
+ return 0;
+ }
+
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
return 0;
}
@@ -457,7 +469,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
-#line 461 "ext/standard/var_unserializer.c"
+#line 473 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -517,9 +529,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 812 "ext/standard/var_unserializer.re"
+#line 824 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 523 "ext/standard/var_unserializer.c"
+#line 535 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -562,13 +574,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
-#line 806 "ext/standard/var_unserializer.re"
+#line 818 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 572 "ext/standard/var_unserializer.c"
+#line 584 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -598,7 +610,7 @@ yy20:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 660 "ext/standard/var_unserializer.re"
+#line 672 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
php_int_t elements;
@@ -744,7 +756,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 748 "ext/standard/var_unserializer.c"
+#line 760 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -769,7 +781,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 652 "ext/standard/var_unserializer.re"
+#line 664 "ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
@@ -777,7 +789,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 781 "ext/standard/var_unserializer.c"
+#line 793 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -798,7 +810,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 632 "ext/standard/var_unserializer.re"
+#line 644 "ext/standard/var_unserializer.re"
{
php_int_t elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -818,7 +830,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 822 "ext/standard/var_unserializer.c"
+#line 834 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -839,7 +851,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 603 "ext/standard/var_unserializer.re"
+#line 615 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -868,7 +880,7 @@ yy41:
ZVAL_STRINGL(*rval, str, len, 0);
return 1;
}
-#line 872 "ext/standard/var_unserializer.c"
+#line 884 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -889,7 +901,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 575 "ext/standard/var_unserializer.re"
+#line 587 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -917,7 +929,7 @@ yy48:
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 921 "ext/standard/var_unserializer.c"
+#line 933 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1005,7 +1017,7 @@ yy61:
}
yy63:
++YYCURSOR;
-#line 565 "ext/standard/var_unserializer.re"
+#line 577 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_INT == 4
use_double:
@@ -1015,7 +1027,7 @@ use_double:
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1019 "ext/standard/var_unserializer.c"
+#line 1031 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1074,7 +1086,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 550 "ext/standard/var_unserializer.re"
+#line 562 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1089,7 +1101,7 @@ yy73:
return 1;
}
-#line 1093 "ext/standard/var_unserializer.c"
+#line 1105 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1116,7 +1128,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 523 "ext/standard/var_unserializer.re"
+#line 535 "ext/standard/var_unserializer.re"
{
#if SIZEOF_ZEND_INT == 4
int digits = YYCURSOR - start - 3;
@@ -1143,7 +1155,7 @@ yy79:
ZVAL_INT(*rval, parse_iv(start + 2));
return 1;
}
-#line 1147 "ext/standard/var_unserializer.c"
+#line 1159 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1151,24 +1163,24 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 516 "ext/standard/var_unserializer.re"
+#line 528 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 1162 "ext/standard/var_unserializer.c"
+#line 1174 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 509 "ext/standard/var_unserializer.re"
+#line 521 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_NULL(*rval);
return 1;
}
-#line 1172 "ext/standard/var_unserializer.c"
+#line 1184 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1191,7 +1203,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 486 "ext/standard/var_unserializer.re"
+#line 498 "ext/standard/var_unserializer.re"
{
php_int_t id;
@@ -1214,7 +1226,7 @@ yy91:
return 1;
}
-#line 1218 "ext/standard/var_unserializer.c"
+#line 1230 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1237,7 +1249,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 465 "ext/standard/var_unserializer.re"
+#line 477 "ext/standard/var_unserializer.re"
{
php_int_t id;
@@ -1258,9 +1270,9 @@ yy97:
return 1;
}
-#line 1262 "ext/standard/var_unserializer.c"
+#line 1274 "ext/standard/var_unserializer.c"
}
-#line 814 "ext/standard/var_unserializer.re"
+#line 826 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 5d418a7626..6cd8a43438 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -400,7 +400,15 @@ static inline php_int_t object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *
(*p) += 2;
- object_init_ex(*rval, ce);
+ if (ce->serialize == NULL) {
+ object_init_ex(*rval, ce);
+ } else {
+ /* If this class implements Serializable, it should not land here but in object_custom(). The passed string
+ obviously doesn't descend from the regular serializer. */
+ zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ce->name);
+ return 0;
+ }
+
return elements;
}
@@ -412,6 +420,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, php_int_t elements)
zval *retval_ptr = NULL;
zval fname;
+ if (Z_TYPE_PP(rval) != IS_OBJECT) {
+ return 0;
+ }
+
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
return 0;
}
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index a36f102591..e0c4837d76 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -312,6 +312,9 @@ static php_cli_server_ext_mime_type_pair mime_type_map[] = {
{ "xls", "application/vnd.ms-excel" },
{ "xlsx", "application/vnd.ms-excel" },
{ "zip", "application/x-zip-compressed" },
+ { "xml", "application/xml" },
+ { "xsl", "application/xml" },
+ { "xsd", "application/xml" },
{ NULL, NULL }
};
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index 71af7a1a0d..a22823d0a9 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -1,7 +1,7 @@
bz2-1.0.6
cclient-2007f
freetype-2.5.3
-icu-52.1
+icu-53.1
jpeglib-9a
libcurl-7.36.0
libiconv-1.14