Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5

* 'PHP-5.5' of git.php.net:php-src: (30 commits)
  Fix duplicated 5.5.2 NEWS in my tree
  fix typo
  merge news for 5.5.2
  Update NEWS
  Update NEWS
  With --enable-dtrace, the correct PIC/non-PIC .o files on Solaris and Linux are now used.  DTrace is part of Oracle Linux.  See https://oss.oracle.com/projects/DTrace/
  fix cve number
  New news section
  Prepare news for PHP-5.5.2
  Reduce compiler noise by removing unused variables and labels
  Fixed #65431 in zend_exception.c by Sixd
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.
  Skip test if SKIP_ONLINE_TESTS set
  Fix CVE-2013-4073 - handling of certs with null bytes
  Fix CVE-2013-4073 - handling of certs with null bytes
  Fixed #65431 (Discarded qualifiers from pointer target warnings when using --enable-dtrace) by Sixd
  removed unused vars
  fixed strndup usage in the pgsql ext
  use mysqlnd, some tests fail otherwise
  ensure notices are not ignored when tests need them
  ...
This commit is contained in:
Yasuo Ohgaki 2013-08-18 12:29:36 +09:00
commit 83e251a055
89 changed files with 1095 additions and 90 deletions

41
NEWS
View File

@ -3,19 +3,9 @@ PHP NEWS
?? ??? 2013, PHP 5.5.3
- Core:
. Fixed bug #62691 (solaris sed has no -i switch). (Chris Jones)
. Fixed bug #61268 (--enable-dtrace leads make to clobber
Zend/zend_dtrace.d) (Chris Jones)
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
- Sessions:
. Implemented strict sessions RFC (https://wiki.php.net/rfc/strict_sessions)
which protects against session fixation attacks and session collisions.
(Yasuo Ohgaki)
- Pgsql:
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
/pg_delete()/pg_insert()). (Yasuo)
?? ??? 2013, PHP 5.5.2
15 Aug 2013, PHP 5.5.2
- Core:
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
@ -26,22 +16,47 @@ PHP NEWS
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
limited case). (Arpad)
. Fixed bug #62691 (solaris sed has no -i switch). (Chris Jones)
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
. Fixed bug #61268 (--enable-dtrace leads make to clobber
Zend/zend_dtrace.d) (Chris Jones)
- DOM:
. Added flags option to DOMDocument::schemaValidate() and
DOMDocument::schemaValidateSource(). Added LIBXML_SCHEMA_CREATE flag.
(Chris Wright)
- OPcache:
. Added opcache.restrict_api configuration directive that may limit
usage of OPcahce API functions only to patricular script(s). (Dmitry)
usage of OPcache API functions only to particular script(s). (Dmitry)
. Added support for glob symbols in blacklist entries (?, *, **).
(Terry Elison, Dmitry)
. Fixed bug #65338 (Enabling both php_opcache and php_wincache AVs on
shutdown). (Dmitry)
- Openssl:
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
(Christian Heimes)
- PDO_mysql:
. Fixed bug #65299 (pdo mysql parsing errors). (Johannes)
- Pgsql:
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
/pg_delete()/pg_insert()). (Yasuo)
- Phar:
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
some specific contents). (Stas)
- Sessions:
. Implemented strict sessions RFC (https://wiki.php.net/rfc/strict_sessions)
which protects against session fixation attacks and session collisions.
(Yasuo Ohgaki)
. Fixed possible buffer overflow under Windows. Note: Not a security fix.
(Yasuo)
. Changed session.auto_start to PHP_INI_PERDIR. (Yasuo)
- SOAP:
. Fixed bug #65018 (SoapHeader problems with SoapServer). (Dmitry)

View File

@ -182,6 +182,10 @@ PHP 5.5 UPGRADE NOTES
- Since 5.5.2, spl_autoload_functions() returns different names for
different lambda functions registered via spl_autoload_register().
- Since 5.5.3, DOMDocument::schemaValidateSource() and
DOMDocument::schemaValidate() accept flag parameter. Only flag
available now is LIBXML_SCHEMA_CREATE. Default is 0.
========================================
5. New Functions
========================================

View File

@ -1098,7 +1098,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if(DTRACE_ERROR_ENABLED()) {
char *dtrace_error_buffer;
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
efree(dtrace_error_buffer);
}
#endif /* HAVE_DTRACE */

View File

@ -24,7 +24,7 @@
#ifdef HAVE_DTRACE
/* PHP DTrace probes {{{ */
static inline char *dtrace_get_executed_filename(TSRMLS_D)
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
{
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
return EG(current_execute_data)->op_array->filename;
@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D)
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
{
zend_op_array *res;
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
res = compile_file(file_handle, type TSRMLS_CC);
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
return res;
}
@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t
ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
{
int lineno;
char *scope, *filename, *funcname, *classname;
const char *scope, *filename, *funcname, *classname;
scope = filename = funcname = classname = NULL;
/* we need filename and lineno for both execute and function probes */
@ -65,41 +65,41 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
}
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
DTRACE_EXECUTE_ENTRY(filename, lineno);
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
}
if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) {
DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope);
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
}
execute_ex(execute_data TSRMLS_CC);
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope);
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
}
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
DTRACE_EXECUTE_RETURN(filename, lineno);
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
}
}
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC)
{
int lineno;
char *filename;
const char *filename;
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
filename = dtrace_get_executed_filename(TSRMLS_C);
lineno = zend_get_executed_lineno(TSRMLS_C);
}
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
DTRACE_EXECUTE_ENTRY(filename, lineno);
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
}
execute_internal(execute_data_ptr, fci, return_value_used TSRMLS_CC);
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
DTRACE_EXECUTE_RETURN(filename, lineno);
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
}
}

View File

@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
char *classname;
int name_len;
const char *classname;
zend_uint name_len;
if (exception != NULL) {
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
DTRACE_EXCEPTION_THROWN(classname);
DTRACE_EXCEPTION_THROWN((char *)classname);
} else {
DTRACE_EXCEPTION_THROWN(NULL);
}

View File

@ -3010,7 +3010,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
DTRACE_EXCEPTION_CAUGHT(ce->name);
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
}
#endif /* HAVE_DTRACE */

View File

@ -7121,7 +7121,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
DTRACE_EXCEPTION_CAUGHT(ce->name);
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
}
#endif /* HAVE_DTRACE */

View File

@ -2925,17 +2925,17 @@ dnl providerdesc
dnl header-file
ac_hdrobj=$2
dnl Add providerdesc.o into global objects when needed
dnl Add providerdesc.o or .lo into global objects when needed
case $host_alias in
*freebsd*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
;;
*solaris*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
*linux*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
esac
@ -2969,12 +2969,46 @@ dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
$abs_srcdir/$ac_provsrc:;
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
EOF
case $host_alias in
*solaris*|*linux*)
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
for ac_lo in $PHP_DTRACE_OBJS; do
dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
done;
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
echo "[#] Generated by Makefile for libtool" > \$[]@
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "pic_object='none'" >> \$[]@ [;\\]
fi
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "non_pic_object='none'" >> \$[]@ [;\\]
fi
EOF
;;
*)
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
EOF
;;
esac
])

View File

@ -1041,7 +1041,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
{
smart_str string = {0};
int i, length;
int i, length = 0;
char buffer[97];
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
@ -2538,8 +2538,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_time *now;
timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst;
char *new_abbr;
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
char *new_abbr = NULL;
timelib_sll new_offset;
if (dateobj->time) {

View File

@ -1973,14 +1973,15 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
xmlDoc *docp;
dom_object *intern;
char *source = NULL, *valid_file = NULL;
int source_len = 0;
int source_len = 0, valid_opts = 0;
long flags = 0;
xmlSchemaParserCtxtPtr parser;
xmlSchemaPtr sptr;
xmlSchemaValidCtxtPtr vptr;
int is_valid;
char resolved_path[MAXPATHLEN + 1];
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
return;
}
@ -2029,6 +2030,13 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
RETURN_FALSE;
}
#if LIBXML_VERSION >= 20614
if (flags & XML_SCHEMA_VAL_VC_I_CREATE) {
valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE;
}
#endif
xmlSchemaSetValidOptions(vptr, valid_opts);
xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr);
is_valid = xmlSchemaValidateDoc(vptr, docp);
xmlSchemaFree(sptr);
@ -2042,14 +2050,14 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
}
/* }}} */
/* {{{ proto boolean dom_document_schema_validate_file(string filename); */
/* {{{ proto boolean dom_document_schema_validate_file(string filename, int flags); */
PHP_FUNCTION(dom_document_schema_validate_file)
{
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
}
/* }}} end dom_document_schema_validate_file */
/* {{{ proto boolean dom_document_schema_validate(string source); */
/* {{{ proto boolean dom_document_schema_validate(string source, int flags); */
PHP_FUNCTION(dom_document_schema_validate_xml)
{
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);

View File

@ -0,0 +1,21 @@
--TEST--
Test DOMDocument::loadXML() basic behavior
--DESCRIPTION--
This test verifies the basic behaviour of the method
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECT--

View File

@ -0,0 +1,26 @@
--TEST--
Test DOMDocument::loadXML() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects an opening and ending tag mismatch
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s

View File

@ -0,0 +1,30 @@
--TEST--
Test DOMDocument::loadXML() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects attributes values not closed between " or '
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed2.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::loadXML() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects a typo in tag names
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed3.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::loadXML() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects an unsupported xml version
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed4.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::loadXML() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects extra content at the end of the document
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed5.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s

View File

@ -0,0 +1,21 @@
--TEST--
Test DOMDocument::loadXML() with LIBXML_DTDLOAD option
--DESCRIPTION--
This test verifies the right behaviour of the LIBXML_DTDLOAD constant
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book_with_dtd2.xml
LOAD_OPTIONS=LIBXML_DTDLOAD
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECT--

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::loadXML() with LIBXML_DTDVALID option
--DESCRIPTION--
This test verifies the right behaviour of the LIBXML_DTDVALID constant
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/wrong_book_with_dtd2.xml
LOAD_OPTIONS=LIBXML_DTDVALID
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::loadXML() with LIBXML_DTDVALID and LIBXML_NOERROR options
--DESCRIPTION--
This test vrifies the right behaviour of the LIBXML_NOERROR constant
which avoids the display of the warning message
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/wrong_book_with_dtd.xml
LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentloadxml_test_method.php
--EXPECT--

View File

@ -0,0 +1,32 @@
--TEST--
Test DOMDocument::loadXML() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS
--DESCRIPTION--
This test verifies the right behaviour of the following constants:
LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book_with_dtd2.xml
LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentloadxml_test_method_savexml.php
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE books [
<!ENTITY entitest "entity is only for test purposes">
<!ATTLIST title default CDATA "default title">
<!ELEMENT books (book)*>
<!ELEMENT book (title , author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
<books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books>

View File

@ -0,0 +1,21 @@
--TEST--
Test DOMDocument::load() basic behavior
--DESCRIPTION--
This test verifies the basic behaviour of the method
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECT--

View File

@ -0,0 +1,26 @@
--TEST--
Test DOMDocument::load() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects an opening and ending tag mismatch
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s

View File

@ -0,0 +1,30 @@
--TEST--
Test DOMDocument::load() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects attributes values not closed between " or '
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed2.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::load() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects and opening and ending tag mismatch
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed3.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::load() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects an unsupported xml version
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed4.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::load() detects not-well formed XML
--DESCRIPTION--
This test verifies the method detects extra content at the end of the document
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/not_well_formed5.xml
LOAD_OPTIONS=0
EXPECTED_RESULT=0
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s

View File

@ -0,0 +1,21 @@
--TEST--
Test DOMDocument::load() with LIBXML_DTDLOAD option
--DESCRIPTION--
This test verifies the right behaviour of the LIBXML_DTDLOAD constant
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book_with_dtd.xml
LOAD_OPTIONS=LIBXML_DTDLOAD
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECT--

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::load() with LIBXML_DTDVALID option
--DESCRIPTION--
This test verifies the right behaviour of the LIBXML_DTDVALID constant
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/wrong_book_with_dtd.xml
LOAD_OPTIONS=LIBXML_DTDVALID
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECTF--
Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s

View File

@ -0,0 +1,22 @@
--TEST--
Test DOMDocument::load() with LIBXML_DTDVALID and LIBXML_NOERROR options
--DESCRIPTION--
This test vrifies the right behaviour of the LIBXML_NOERROR constant
which avoids the display of the warning message
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/wrong_book_with_dtd.xml
LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentload_test_method.php
--EXPECT--

View File

@ -0,0 +1,25 @@
--TEST--
Test DOMDocument::load() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS
--DESCRIPTION--
This test verifies the right behaviour of the following constants:
LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS
Environment variables used in the test:
- XML_FILE: the xml file to load
- LOAD_OPTIONS: the second parameter to pass to the method
- EXPECTED_RESULT: the expected result
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--ENV--
XML_FILE=/book_with_dtd.xml
LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS
EXPECTED_RESULT=1
--FILE_EXTERNAL--
domdocumentload_test_method_savexml.php
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE books SYSTEM "books.dtd">
<books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books>

View File

@ -0,0 +1,25 @@
--TEST--
DomDocument::schemaValidateSource() - Add missing attribute default values from schema
--CREDITS--
Chris Wright <info@daverandom.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book-attr.xml");
$xsd = file_get_contents(dirname(__FILE__)."/book.xsd");
$doc->schemaValidateSource($xsd, LIBXML_SCHEMA_CREATE);
foreach ($doc->getElementsByTagName('book') as $book) {
var_dump($book->getAttribute('is-hardback'));
}
?>
--EXPECT--
string(5) "false"
string(4) "true"

View File

@ -17,5 +17,5 @@ var_dump($result);
?>
--EXPECTF--
Warning: DOMDocument::schemaValidateSource() expects exactly 1 parameter, 0 given in %s.php on line %d
Warning: DOMDocument::schemaValidateSource() expects at least 1 parameter, 0 given in %s.php on line %d
NULL

View File

@ -0,0 +1,25 @@
--TEST--
DomDocument::schemaValidateSource() - Don't add missing attribute default values from schema
--CREDITS--
Chris Wright <info@daverandom.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book-attr.xml");
$xsd = file_get_contents(dirname(__FILE__)."/book.xsd");
$doc->schemaValidateSource($xsd);
foreach ($doc->getElementsByTagName('book') as $book) {
var_dump($book->getAttribute('is-hardback'));
}
?>
--EXPECT--
string(0) ""
string(4) "true"

View File

@ -0,0 +1,23 @@
--TEST--
DomDocument::schemaValidate() - Add missing attribute default values from schema
--CREDITS--
Chris Wright <info@daverandom.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book-attr.xml");
$doc->schemaValidate(dirname(__FILE__)."/book.xsd", LIBXML_SCHEMA_CREATE);
foreach ($doc->getElementsByTagName('book') as $book) {
var_dump($book->getAttribute('is-hardback'));
}
?>
--EXPECT--
string(5) "false"
string(4) "true"

View File

@ -17,5 +17,5 @@ var_dump($result);
?>
--EXPECTF--
Warning: DOMDocument::schemaValidate() expects exactly 1 parameter, 0 given in %s.php on line %d
Warning: DOMDocument::schemaValidate() expects at least 1 parameter, 0 given in %s.php on line %d
NULL

View File

@ -0,0 +1,23 @@
--TEST--
DomDocument::schemaValidate() - Don't add missing attribute default values from schema
--CREDITS--
Chris Wright <info@daverandom.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->load(dirname(__FILE__)."/book-attr.xml");
$doc->schemaValidate(dirname(__FILE__)."/book.xsd");
foreach ($doc->getElementsByTagName('book') as $book) {
var_dump($book->getAttribute('is-hardback'));
}
?>
--EXPECT--
string(0) ""
string(4) "true"

View File

@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book is-hardback="true">
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -9,6 +9,7 @@
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
</xs:sequence>
<xs:attribute name="is-hardback" type="xs:boolean" default="false" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE books SYSTEM "books.dtd">
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
<book>
<title>&entitest;</title>
<author><![CDATA[data for test]]></author>
</book>
</books>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE books [
<!ENTITY entitest "entity is only for test purposes">
<!ATTLIST title default CDATA "default title">
<!ELEMENT books (book*)>
<!ELEMENT book (title, author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
<book>
<title>&entitest;</title>
<author><![CDATA[data for test]]></author>
</book>
</books>

7
ext/dom/tests/books.dtd Normal file
View File

@ -0,0 +1,7 @@
<!ENTITY entitest "entity is only for test purposes">
<!ATTLIST title
default CDATA "default title">
<!ELEMENT books (book*)>
<!ELEMENT book (title, author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>

View File

@ -0,0 +1,12 @@
<?php
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
$doc = new DOMDocument();
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
$result = $doc->load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options);
$expectedResult = (bool) getenv('EXPECTED_RESULT');
assert('$result === $expectedResult');
?>

View File

@ -0,0 +1,14 @@
<?php
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
$doc = new DOMDocument();
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
$result = $doc->load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options);
$expectedResult = (bool) getenv('EXPECTED_RESULT');
assert('$result === $expectedResult');
echo $doc->saveXML();
?>

View File

@ -0,0 +1,16 @@
<?php
function libxml_options_to_int($libxmlOptions) {
$defined_constants = get_defined_constants(true);
$env_array = explode('|', $libxmlOptions);
$libxml_constants = array_intersect_key($defined_constants['libxml'], array_flip($env_array));
$sum = 0;
foreach($libxml_constants as $value) {
$sum = $sum|$value;
}
return $sum;
}
?>

View File

@ -0,0 +1,12 @@
<?php
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
$doc = new DOMDocument();
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')),
$libxml_options);
$expectedResult = (bool) getenv('EXPECTED_RESULT');
assert('$result === $expectedResult');
?>

View File

@ -0,0 +1,14 @@
<?php
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
$doc = new DOMDocument();
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')),
$libxml_options);
$expectedResult = (bool) getenv('EXPECTED_RESULT');
assert('$result === $expectedResult');
echo $doc->saveXML();
?>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<!-- Opening and ending tag mismatch -->
<books>
<book>
<title>The Grapes of Wrath
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<!-- AttValue: " or ' expected -->
<books>
<book number=nine>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<!-- Opening and ending tag mismatch -->
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<boOk>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -0,0 +1,12 @@
<?xml version="3.1" ?>
<!-- Unsupported version '3.1' -->
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<!-- Extra content at the end of the document -->
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE books SYSTEM "books.dtd">
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE books [
<!ENTITY entitest "entity is only for test purposes">
<!ATTLIST title default CDATA "default title">
<!ELEMENT books (book)*>
<!ELEMENT book (title , author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>

View File

@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = {
static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
{
zval **args;
zval **args = NULL;
zval *retval;
int result, i, ret;
int error = 0;

View File

@ -2434,7 +2434,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
fflush(fp);
}
register_im:
/* register_im: */
if (im) {
ZEND_REGISTER_RESOURCE(return_value, im, le_gd);
php_stream_close(stream);

View File

@ -3011,7 +3011,6 @@ void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P)
int gdImagePaletteToTrueColor(gdImagePtr src)
{
unsigned int y;
unsigned char alloc_y = 0;
unsigned int yy;
if (src == NULL) {

View File

@ -1069,7 +1069,7 @@ ZEND_FUNCTION(gmp_powm)
zval **base_arg, **exp_arg, **mod_arg;
mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result;
int use_ui = 0;
int temp_base, temp_exp, temp_mod;
int temp_base = 0, temp_exp = 0, temp_mod;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ", &base_arg, &exp_arg, &mod_arg) == FAILURE){
return;

View File

@ -130,7 +130,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
/* {{{ grapheme_strpos_utf16 - strrpos using utf16*/
int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC)
{
UChar *uhaystack = NULL, *puhaystack, *uneedle = NULL;
UChar *uhaystack = NULL, *uneedle = NULL;
int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0;
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];
UBreakIterator* bi = NULL;

View File

@ -161,8 +161,8 @@ PHP_FUNCTION( resourcebundle_create )
/* {{{ resourcebundle_array_fetch */
static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC)
{
int32_t meindex;
char * mekey;
int32_t meindex = 0;
char * mekey = NULL;
long mekeylen;
zend_bool is_numeric = 0;
char *pbuf;

View File

@ -44,6 +44,7 @@
#include <libxml/xmlsave.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>
#include <libxml/xmlschemas.h>
#endif
#include "php_libxml.h"
@ -798,6 +799,11 @@ static PHP_MINIT_FUNCTION(libxml)
#endif
REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT);
/* Schema validation options */
#if defined(LIBXML_SCHEMAS_ENABLED) && LIBXML_VERSION >= 20614
REGISTER_LONG_CONSTANT("LIBXML_SCHEMA_CREATE", XML_SCHEMA_VAL_VC_I_CREATE, CONST_CS | CONST_PERSISTENT);
#endif
/* Additional constants for use with loading html */
#if LIBXML_VERSION >= 20707
REGISTER_LONG_CONSTANT("LIBXML_HTML_NOIMPLIED", HTML_PARSE_NOIMPLIED, CONST_CS | CONST_PERSISTENT);

View File

@ -591,7 +591,7 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
for (i = 0; i < X509_NAME_entry_count(name); i++) {
unsigned char *to_add;
int to_add_len;
int to_add_len = 0;
ne = X509_NAME_get_entry(name, i);
@ -1411,6 +1411,74 @@ PHP_FUNCTION(openssl_x509_check_private_key)
}
/* }}} */
/* Special handling of subjectAltName, see CVE-2013-4073
* Christian Heimes
*/
static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
{
GENERAL_NAMES *names;
const X509V3_EXT_METHOD *method = NULL;
long i, length, num;
const unsigned char *p;
method = X509V3_EXT_get(extension);
if (method == NULL) {
return -1;
}
p = extension->value->data;
length = extension->value->length;
if (method->it) {
names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length,
ASN1_ITEM_ptr(method->it)));
} else {
names = (GENERAL_NAMES*)(method->d2i(NULL, &p, length));
}
if (names == NULL) {
return -1;
}
num = sk_GENERAL_NAME_num(names);
for (i = 0; i < num; i++) {
GENERAL_NAME *name;
ASN1_STRING *as;
name = sk_GENERAL_NAME_value(names, i);
switch (name->type) {
case GEN_EMAIL:
BIO_puts(bio, "email:");
as = name->d.rfc822Name;
BIO_write(bio, ASN1_STRING_data(as),
ASN1_STRING_length(as));
break;
case GEN_DNS:
BIO_puts(bio, "DNS:");
as = name->d.dNSName;
BIO_write(bio, ASN1_STRING_data(as),
ASN1_STRING_length(as));
break;
case GEN_URI:
BIO_puts(bio, "URI:");
as = name->d.uniformResourceIdentifier;
BIO_write(bio, ASN1_STRING_data(as),
ASN1_STRING_length(as));
break;
default:
/* use builtin print for GEN_OTHERNAME, GEN_X400,
* GEN_EDIPARTY, GEN_DIRNAME, GEN_IPADD and GEN_RID
*/
GENERAL_NAME_print(bio, name);
}
/* trailing ', ' except for last element */
if (i < (num - 1)) {
BIO_puts(bio, ", ");
}
}
sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
return 0;
}
/* {{{ proto array openssl_x509_parse(mixed x509 [, bool shortnames=true])
Returns an array of the fields/values of the CERT */
PHP_FUNCTION(openssl_x509_parse)
@ -1507,15 +1575,29 @@ PHP_FUNCTION(openssl_x509_parse)
for (i = 0; i < X509_get_ext_count(cert); i++) {
int nid;
extension = X509_get_ext(cert, i);
if (OBJ_obj2nid(X509_EXTENSION_get_object(extension)) != NID_undef) {
nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension));
if (nid != NID_undef) {
extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension)));
} else {
OBJ_obj2txt(buf, sizeof(buf)-1, X509_EXTENSION_get_object(extension), 1);
extname = buf;
}
bio_out = BIO_new(BIO_s_mem());
if (X509V3_EXT_print(bio_out, extension, 0, 0)) {
if (nid == NID_subject_alt_name) {
if (openssl_x509v3_subjectAltName(bio_out, extension) == 0) {
add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1);
} else {
zval_dtor(return_value);
if (certresource == -1 && cert) {
X509_free(cert);
}
BIO_free(bio_out);
RETURN_FALSE;
}
}
else if (X509V3_EXT_print(bio_out, extension, 0, 0)) {
BIO_get_mem_ptr(bio_out, &bio_buf);
add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1);
} else {

View File

@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-----END CERTIFICATE-----

View File

@ -0,0 +1,19 @@
--TEST--
CVE 2013-4073: Null-byte certificate handling
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
--FILE--
<?php
$cert = file_get_contents(__DIR__ . '/cve2013_4073.pem');
$info = openssl_x509_parse($cert);
var_export($info['extensions']);
--EXPECTF--
array (
'basicConstraints' => 'CA:FALSE',
'subjectKeyIdentifier' => '88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C',
'keyUsage' => 'Digital Signature, Non Repudiation, Key Encipherment',
'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:null@python.org' . "\0" . 'user@example.org, URI:http://null.python.org' . "\0" . 'http://example.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
',
)

View File

@ -472,7 +472,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
do {
struct timeval cur_time,
elapsed_time;
elapsed_time = {0};
if (sslsock->is_client) {
n = SSL_connect(sslsock->ssl_handle);

View File

@ -966,8 +966,30 @@ static char *_php_pgsql_escape_identifier(const char *field, size_t field_len)
field_escaped[j] = '\0';
return field_escaped;
}
/* }}} */
#endif
/* {{{ _php_pgsql_strndup, no strndup should be used */
static char *_php_pgsql_strndup(const char *s, size_t len)
{
char *new;
if (NULL == s) {
return (char *)NULL;
}
new = (char *) malloc(len + 1);
if (NULL == new) {
return (char *)NULL;
}
new[len] = '\0';
return memmove(new, s, len);
}
/* }}} */
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
@ -4328,7 +4350,6 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
char *from = NULL, *to = NULL, *tmp = NULL;
zval *pgsql_link = NULL;
PGconn *pgsql;
int to_len;
int from_len;
int id = -1;
@ -6005,10 +6026,10 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
/* If field is NULL and HAS DEFAULT, should be skipped */
if (!skip_field) {
char *escaped;
size_t new_len, field_len = strlen(field);
size_t field_len = strlen(field);
if (_php_pgsql_detect_identifier_escape(field, field_len) == SUCCESS) {
escaped = strndup(field, field_len);
escaped = _php_pgsql_strndup(field, field_len);
} else {
#if HAVE_PQESCAPELITERAL
escaped = PQescapeIdentifier(pg_link, field, field_len);
@ -6102,7 +6123,7 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
token = php_strtok_r(table_copy, ".", &tmp);
len = strlen(token);
if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
escaped = strndup(token, len);
escaped = _php_pgsql_strndup(token, len);
} else {
#if HAVE_PQESCAPELITERAL
escaped = PQescapeIdentifier(pg_link, token, len);
@ -6116,7 +6137,7 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
len = strlen(tmp);
/* "schema"."table" format */
if (_php_pgsql_detect_identifier_escape(tmp, len) == SUCCESS) {
escaped = strndup(tmp, len);
escaped = _php_pgsql_strndup(tmp, len);
} else {
#if HAVE_PQESCAPELITERAL
escaped = PQescapeIdentifier(pg_link, tmp, len);

View File

@ -10,7 +10,7 @@ _skip_lc_messages();
?>
--INI--
pgsql.log_notice=1
pgsql.ignore_notices=0
pgsql.ignore_notice=0
--FILE--
<?php
include 'config.inc';

View File

@ -15,6 +15,8 @@ end;
' LANGUAGE plpgsql;");
if (!$res) die('skip PLPGSQL not available');
?>
--INI--
pgsql.ignore_notice=0
--FILE--
<?php

View File

@ -15,6 +15,8 @@ end;
' LANGUAGE plpgsql;");
if (!$res) die('skip PLPGSQL not available');
?>
--INI--
pgsql.ignore_notice=0
--FILE--
<?php

View File

@ -286,7 +286,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
PHP_MD5_CTX md5_context;
PHP_SHA1_CTX sha1_context;
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
void *hash_context;
void *hash_context = NULL;
#endif
unsigned char *digest;
int digest_len;
@ -346,7 +346,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
unsigned char rbuf[2048];
size_t toread = PS(entropy_length);
if (php_win32_get_random_bytes(rbuf, (size_t) toread) == SUCCESS){
if (php_win32_get_random_bytes(rbuf, MIN(toread, sizeof(rbuf))) == SUCCESS){
switch (PS(hash_func)) {
case PS_HASH_FUNC_MD5:

View File

@ -1070,7 +1070,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{
int namelen;
int test;
char use_iter;
zval *iter_data;
zval *iter_data = NULL;
use_iter = 0;

View File

@ -514,7 +514,7 @@ static zend_object_value php_snmp_object_new(zend_class_entry *class_type TSRMLS
static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object;
php_snmp_object *snmp_object = NULL;
if (object) {
snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC);

View File

@ -166,7 +166,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object,
/* {{{ spl_array_object_new_ex */
static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig, int clone_orig TSRMLS_DC)
{
zend_object_value retval;
zend_object_value retval = {0};
spl_array_object *intern;
zval *tmp;
zend_class_entry * parent = class_type;

View File

@ -368,7 +368,7 @@ zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object
static zend_object_value spl_dllist_object_new_ex(zend_class_entry *class_type, spl_dllist_object **obj, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
{
zend_object_value retval;
zend_object_value retval = {0};
spl_dllist_object *intern;
zend_class_entry *parent = class_type;
int inherited = 0;

View File

@ -3030,8 +3030,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
zend_fcall_info *fci_key, *fci_data;
zend_fcall_info_cache *fci_key_cache, *fci_data_cache;
zend_fcall_info *fci_key = NULL, *fci_data;
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC);
@ -3448,8 +3448,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
zend_fcall_info *fci_key, *fci_data;
zend_fcall_info_cache *fci_key_cache, *fci_data_cache;
zend_fcall_info *fci_key = NULL, *fci_data;
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC);
@ -4053,7 +4053,6 @@ PHP_FUNCTION(array_sum)
**entry,
entry_n;
HashPosition pos;
double dval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
return;

View File

@ -1221,8 +1221,8 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size
const enc_to_uni *to_uni_table = NULL;
const entity_ht *inv_map = NULL; /* used for !double_encode */
/* only used if flags includes ENT_HTML_IGNORE_ERRORS or ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS */
const unsigned char *replacement;
size_t replacement_len;
const unsigned char *replacement = NULL;
size_t replacement_len = 0;
if (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) {
@ -1596,7 +1596,7 @@ PHP_FUNCTION(get_html_translation_table)
flags = ENT_COMPAT;
int doctype;
entity_table_opt entity_table;
const enc_to_uni *to_uni_table;
const enc_to_uni *to_uni_table = NULL;
char *charset_hint = NULL;
int charset_hint_len;
enum entity_charset charset;

View File

@ -3204,7 +3204,7 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2, int le
static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2)
{
int sum;
int pos1, pos2, max;
int pos1 = 0, pos2 = 0, max;
php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max);
if ((sum = max)) {
@ -4564,7 +4564,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
char *tbuf, *buf, *p, *tp, *rp, c, lc;
int br, i=0, depth=0, in_q = 0;
int state = 0, pos;
char *allow_free;
char *allow_free = NULL;
if (stateptr)
state = *stateptr;

View File

@ -10,6 +10,7 @@ display_errors=false
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (!function_exists("file_get_contents"))
die ("skip file_get_contents function is not found");
if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
?>
--FILE--
<?php

View File

@ -1011,7 +1011,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
{
char *encoded;
char *encoded = NULL;
int encoded_len;
smart_str val;

View File

@ -463,7 +463,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
{
char *encoded;
char *encoded = NULL;
int encoded_len;
smart_str val;

View File

@ -476,7 +476,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */
{
xmlDocPtr newdocp;
xmlDocPtr newdocp = NULL;
xmlDocPtr doc = NULL;
xmlNodePtr node = NULL;
xsltTransformContextPtr ctxt;

View File

@ -1654,7 +1654,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
char *path = NULL;
char *remove_path = NULL;
char *add_path = NULL;
int pattern_len, add_path_len, remove_path_len, path_len = 0;
int pattern_len, add_path_len = 0, remove_path_len = 0, path_len = 0;
long remove_all_path = 0;
long flags = 0;
zval *options = NULL;

View File

@ -1526,7 +1526,7 @@ int php_request_startup(TSRMLS_D)
int retval = SUCCESS;
#ifdef HAVE_DTRACE
DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method));
DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method));
#endif /* HAVE_DTRACE */
#ifdef PHP_WIN32
@ -1836,7 +1836,7 @@ void php_request_shutdown(void *dummy)
#endif
#ifdef HAVE_DTRACE
DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method));
DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method));
#endif /* HAVE_DTRACE */
}
/* }}} */

View File

@ -55,7 +55,7 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva
PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC)
{
char *p = NULL;
char *ip; /* index pointer */
char *ip = NULL; /* index pointer */
char *index;
char *var, *var_orig;
int var_len, index_len;

View File

@ -398,7 +398,7 @@ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC)
static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC)
{
char *line;
mime_header_entry prev_entry, entry;
mime_header_entry prev_entry = {0}, entry;
int prev_len, cur_len;
/* didn't find boundary, abort */

View File

@ -907,7 +907,6 @@ default_socket_timeout = 60
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
;;;;;;;;;;;;;;;;;;;
; Module Settings ;

View File

@ -907,7 +907,6 @@ default_socket_timeout = 60
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
;;;;;;;;;;;;;;;;;;;
; Module Settings ;

View File

@ -5,6 +5,7 @@ $(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CGI_OBJS)
install-cgi: $(SAPI_CGI_PATH)
@echo "Installing PHP CGI binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT)
@echo "Installing PHP CGI man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1

View File

@ -1335,7 +1335,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
static const char *index_files[] = { "index.php", "index.html", NULL };
char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1);
char *p = buf, *prev_path = NULL, *q, *vpath;
size_t prev_path_len;
size_t prev_path_len = 0;
int is_static_file = 0;
if (!buf) {

View File

@ -1,9 +1,9 @@
#!/bin/bash
./buildconf
./configure --quiet \
--with-pdo-mysql \
--with-mysql \
--with-mysqli \
--with-pdo-mysql=mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pgsql \
--with-pdo-pgsql \
--with-pdo-sqlite \