Compare commits

...
Author SHA1 Message Date
Anatol Belski 1186b81514 Set versions 2017-10-10 08:34:55 +02:00
Anatol Belski f48abfa902 Fix array access on undeclared properties in DateInterval 2017-10-09 15:35:38 +02:00
Sara Golemon 843e492c68 Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS 2017-10-07 10:08:34 -04:00
Christoph M. Becker ec3d864784 Fixed bug #75318 (The parameter of UConverter::getAliases() is not optional)
Of course, reflection has to know that as well.
2017-10-06 16:45:07 +02:00
Mathieu CARBONNEAUX 6b9ccda936 Fixed bug #75311 2017-10-05 12:24:57 +02:00
Dmitry Stogov 1195de87ff Bumped ext/oci8 version 2017-10-04 09:56:25 +03:00
Dmitry Stogov ee50fcfa27 Merge branch 'oci8_fix' into PHP-7.0
* oci8_fix:
  Use dereferenced value
  Fixed compilation errors
  Restored code for BOOL variables
  Fixed few ext/oci8 bugs
2017-10-04 09:49:40 +03:00
Dmitry Stogov 24e595bf26 Use dereferenced value 2017-10-03 10:49:56 +03:00
Viktor Szépe e995b7e475 Typo in status.html
feet needs -> fit needs
2017-10-03 07:21:53 +01:00
Peter Kokot 6d1dd8b0af Fix bug #74905 2017-10-03 07:18:38 +01:00
Peter Kokot 7b248a1b32 Remove ident gitattribute for ext/zip/php_zip.c 2017-10-03 07:14:50 +01:00
Dmitry Stogov 4d69587035 Fixed compilation errors 2017-10-03 09:08:28 +03:00
Dmitry Stogov c8dea7ae1e Restored code for BOOL variables 2017-10-02 17:04:26 +03:00
Andrea Faulds abefb6dfe7 Fix bug #75290 2017-09-29 21:38:08 +01:00
Anatol Belski d11fceab15 Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636
2017-09-28 15:40:49 +02:00
Peter Kokot 29e673f8ed Fix CGI m4 config message when CGI is disabled 2017-09-27 06:20:09 +01:00
Peter Kokot 6d0391b1a4 Fix bug #75248 and #75251 2017-09-27 06:15:12 +01:00
Nester a680d701ce Fixed #75220 - Segfault when calling is_callable on parent 2017-09-27 06:07:24 +01:00
Peter Kokot 3752d18ffe Remove some old sapi/apache_hooks and sapi/apache leftovers 2017-09-25 21:56:39 +02:00
Xinchen Hui b05ff14a9a Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()). 2017-09-24 17:24:11 +08:00
Xinchen Hui db63367871 Compiler warning 2017-09-24 17:19:05 +08:00
Nikita Popov 73d6456d7d Fixed bug #75252 2017-09-24 08:53:27 +02:00
Anatol Belski da2f581833 Fix thread safety 2017-09-21 10:32:09 +02:00
Andrea Faulds 418f97443a Fix bug #75236 2017-09-21 00:02:52 +01:00
Dmitry Stogov 9a01fe712a Fixed few ext/oci8 bugs 2017-09-20 16:46:04 +03:00
Christoph M. Becker eedc060c92 Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
We must not overwrite the SPL_DLLIST_IT_FIX flag when changing the
iterator mode.
2017-09-20 15:46:04 +02:00
Anatol Belski 9641586efa Fix the version check causing the test fail 2017-09-18 12:04:31 +02:00
Anatol Belski 7670590efd Update lib_versions.txt 2017-09-18 09:34:58 +02:00
Anatol Belski 7910c1dee9 Move to next binary SDK version for AppVeyor 2017-09-15 23:04:15 +02:00
Dmitry Stogov d7a10f0e32 Properly update string type flags 2017-09-13 01:45:57 +03:00
Dmitry Stogov 83d8ebc991 Revert "Properly update string type flags"
This reverts commit 99b1a62d55.
2017-09-13 00:14:39 +03:00
Dmitry Stogov 2874fa8fb0 Fixed test 2017-09-12 23:47:22 +03:00
Dmitry Stogov 99b1a62d55 Properly update string type flags 2017-09-12 23:42:51 +03:00
Anatol Belski 7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Remi Collet 35deb4c88b drop symbol definition, and not defined anywhere 2017-09-12 13:03:18 +02:00
Anatol Belski 3d1cb7e32c [ci skip] update NEWS 2017-09-12 12:17:12 +02:00
Remi Collet b09497c0e2 Fixed bug #75193 segfault in collator_convert_object_to_string 2017-09-12 12:12:06 +02:00
Anatol Belski 5cf215536b Move dev to 7.0.25 2017-09-12 09:02:01 +02:00
Anatol Belski 194547f591 [ci skip] Fix news entry format 2017-09-12 08:35:10 +02:00
jhdxr 3e11b7fc21 fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop 2017-09-12 07:05:58 +01:00
Christoph M. Becker 9aa6898b9b Fixed bug #46781 (BC math handles minus zero incorrectly)
Actually, there is no negative zero at all.  We obey Postel's law, and
still accept negative zeroes, but we store them as positive zeroes
after the conversion from string, i.e. we normalize before further
processing.
2017-09-11 23:44:23 +02:00
Anatol Belski d103802003 Fork test to keep up with libxsl >= 1.1.30
The behavior of date parsing has changed and is reflected in the
changelog. Invalid dates are not accepted, in particular dates with a
negative year, as in this test.
2017-09-11 18:14:51 +02:00
Anatol Belski 04a6bbae6c Add symbol to libxml exports 2017-09-11 17:35:25 +02:00
Anatol Belski cab41ecb93 Fix test compat with libxml2 2.9.5
One warning disappeared, but the flow is still valid.
2017-09-11 16:12:04 +02:00
Anatol Belski 3549d9184a Fix test compat with libxml2 2.9.5
From 2.9.5 on libxml explcitly initializes the keepBlanks flag.
2017-09-11 14:32:54 +02:00
Anatol Belski 5f9ae45e22 Fix test compatibility with libxml2 2.9.5 2017-09-11 12:12:19 +02:00
Christoph M. Becker 4b746fce1c Fixed bug #73730 (textdomain(null) throws in strict mode)
The $text_domain parameter may be NULL, which we have to cater to
explicitly with regard to strict_types.
2017-09-10 18:39:29 +02:00
Christoph M. Becker 3fd08a1595 Fix bug75178.phpt on Windows
bug75178.phpt fails on Windows, because the stderr output is not
interspersed with stdout output there, but rather is appended to the
end. The fix is analogous to bug72093.phpt.
2017-09-09 16:46:32 +02:00
Christoph M. Becker 44eec946e8 Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
Since `bcpowmod()` does not support non-integral operands, we have to
truncate these in addition to emitting a respective warning. We also
have to work with the truncated values in the following.

We recognize that the division by one to enforce the truncation is
actually overkill, but we stick with it for now, and shall tackle the
issue for PHP 7.3.
2017-09-09 13:18:26 +02:00
Sara Golemon 0413feb29c Add BC define for users of the typoed zend_symbtable_add_new 2017-09-07 17:35:54 -04:00
Sara Golemon f18cf46d07 Fix typo in zend_symtable_add_new() API name 2017-09-07 16:25:25 -04:00
Christoph M. Becker b2919853f8 Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
`x mod 1` is always zero; we have to take the scale into account,
though.
2017-09-07 00:30:05 +02:00
Christoph M. Becker dea41f3c3a Fixed bug #44995 (bcpowmod() fails if scale != 0)
`bc_divmod()` is supposed to do integer division, so we must not apply
a scale factor here.
2017-09-06 23:30:53 +02:00
Nikita Popov 42549b7844 Add missing null termination 2017-09-05 18:13:50 +02:00
Bouke van der Bijl cd9d90f4d4 Fixed bug #70470 2017-09-05 16:23:32 +02:00
Anatol Belski 24da62d342 Fix command 2017-09-02 16:56:52 +02:00
Christoph M. Becker e20a6b0213 Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?)
We back-port https://github.com/libgd/libgd/commit/dd48286 even though
we cannot come up with a regression test, because the erroneous
condition appears to be impossible to trigger.

We also parenthesize the inner ternary operation to avoid confusion.
2017-09-02 00:04:02 +02:00
Anatol Belski a86df6bcb0 Make for exclusion per regex 2017-08-31 23:56:42 +02:00
Anatol Belski 6ec494016b Extend ignore list for DLLs to not to look after
fix typo
2017-08-31 20:54:11 +02:00
Dylan K. Taylor 2e77f5eed3 Fix nmake install fails when there are no shared extensions
check for existence instead of muting everything

check for exe existence before trying to copy
2017-08-31 20:32:36 +02:00
Dylan K. Taylor 4e9c3e9396 Copy dependencies of the core DLL in nmake snap for statically-compiled extensions when packaging builds 2017-08-31 19:46:47 +02:00
Remi Collet 3239f6d679 move AC_DEFINE in the right position (in bundled lib conditon) 2017-08-31 07:55:45 +02:00
Anatol Belski 0966f9de41 Move to next bin SDK version for AppVeyor 2017-08-28 13:12:51 +02:00
Christoph M. Becker 499f5480f1 Fixed bug #75124 (gdImageGrayScale() may produce colors)
We have to make sure to avoid alpha-blending issues by explicitly
switching to `gdEffectReplace` and to restore the old value afterwards.

This is a port of <https://github.com/libgd/libgd/commit/a7a7ece>.
2017-08-27 13:53:39 +02:00
Thomas Punt be9edd83c2 Fixed bug #75090 2017-08-25 22:02:19 +02:00
Anatol Belski 55db2c31cd update libs versions 2017-08-25 11:28:12 +02:00
Remi Collet b7e96f8e0e From documentation, only the sign of returned value is relevant
With recent glibc, memcmp sometime return a negative value instead of -1
2017-08-24 10:27:38 +02:00
Tianfang Yang 4bf1a11c07 Merge branch 'pull-request/2534' into PHP-7.0
* pull-request/2534:
  Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized before PHP-FPM sets it up)
2017-08-22 01:10:58 -04:00
Ingmar Runge 079bc324cd Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized before PHP-FPM sets it up) 2017-08-22 01:09:35 -04:00
Andrea Faulds 61538ebadc Fixed bug #75097 (gethostname fails if your host name is 64 chars long)
PHP contained two different off-by-one errors, which are fixed here. First,
it created a buffer of size HOST_NAME_MAX, not adding space for a null
terminator. Second, it subtracted 1 from the size of that buffer when passing
its size to gethostname(), despite gethostname() expecting it to be a buffer
size including space for a terminating null byte, not a string length.
2017-08-19 20:31:54 +01:00
Anatol Belski 3cad07b84f [ci skip] update NEWS 2017-08-19 02:40:17 +02:00
John Boehr 71b12940d0 Fix issues with phpt and EXTENSION on windows (BUG 75042)
* Commands are not properly escaped for windows
* Specifying "-n" to check loaded modules causes "Module already loaded"
warning
* Extensions to be loaded need the "php_" prefix on Windows

Bug: https://bugs.php.net/bug.php?id=75042

Add back -n flag to fetch loaded extensions in run-tests.php

Add test for phpt EXTENSIONS directive

Add a second test for bug 75042

Add test to test loading of nonexistent shared module

with the EXTENSIONS phpt block

Pass ini settings when checking loaded extensions

Fix skipifs
2017-08-19 01:59:48 +02:00
Anatol Belski ba59b6f11b Fix .pgd name for ts build 2017-08-19 00:31:04 +02:00
Remi Collet b28912b0f7 NEWS 2017-08-18 14:52:11 +02:00
Remi Collet a7594cb74f Fixed bug #75093 OpenSSL support not detected 2017-08-18 14:51:44 +02:00
Anatol Belski 065551bc9c Fix phpize exit status
Configure and others are generated, not copied. Seems there's yet much
more to do wrt exit status catching.
2017-08-18 11:54:56 +02:00
Anatol Belski e7f4e67155 Add dump env target 2017-08-18 11:08:27 +02:00
Derick Rethans 60a6feed07 Revert "Upgrade timelib to 2017.05beta7"
This reverts commit bdd56f3107.
2017-08-16 15:19:18 +01:00
Derick Rethans 8af70958fc Revert "Remove removed header files from configuration files."
This reverts commit 3df753c6ca.
2017-08-16 15:19:11 +01:00
Derick Rethans 5d2c303438 Fixed stupid test 2017-08-16 11:14:41 +01:00
Derick Rethans 7829f9b1d2 Added timelib version to phpinfo() 2017-08-16 09:51:21 +01:00
Remi Collet 01735f4d9f cleanup 2017-08-16 07:46:07 +02:00
Derick Rethans 3df753c6ca Remove removed header files from configuration files. 2017-08-15 20:22:41 +01:00
Derick Rethans bdd56f3107 Upgrade timelib to 2017.05beta7 2017-08-15 14:10:23 +01:00
88 changed files with 1238 additions and 262 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.9
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.11
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
-4
View File
@@ -15,11 +15,8 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.txt ident
Zend/RFCs/003.txt ident
ext/exif/exif.c ident
@@ -32,7 +29,6 @@ UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/ereg/tests/eregi_basic_002.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
-2
View File
@@ -262,9 +262,7 @@ pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache/libphp7.module
sapi/apache2handler/libphp7.module
sapi/apache_hooks/libphp7.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
+4 -4
View File
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
all: $(all_targets)
all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@@ -112,13 +112,13 @@ test: all
clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f php7.spec main/build-defs.h scripts/phpize
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
@@ -135,7 +135,7 @@ prof-gen:
prof-clean:
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+71 -1
View File
@@ -1,8 +1,78 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017 PHP 7.0.24
12 Oct 2017 PHP 7.0.25RC1
- Core:
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
(Laruence)
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
request). (Nikita)
. Fixed bug #75220 (Segfault when calling is_callable on parent).
(andrewnester)
. Fixed bug #75290 (debug info of Closures of internal functions contain
garbage argument names). (Andrea)
- Apache2Handler:
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
apache2handler). (mcarbonneaux)
- Intl:
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
optional). (cmb)
- OCI8:
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
- SPL:
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
(J. Jeising, cmb)
28 Sep 2017 PHP 7.0.24
- Core:
. Fixed bug #75042 (run-tests.php issues with EXTENSION block). (John Boehr)
- BCMath:
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
. Fixed bug #46781 (BC math handles minus zero incorrectly). (cmb)
. Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1). (okano1220, cmb)
. Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus). (cmb)
- CLI server:
. Fixed bug #70470 (Built-in server truncates headers spanning over TCP
packets). (bouk)
- CURL:
. Fixed bug #75093 (OpenSSL support not detected). (Remi)
- GD:
. Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
. Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)
- Gettext:
. Fixed bug #73730 (textdomain(null) throws in strict mode). (cmb)
- Intl:
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
class). (tpunt)
. Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
- PDO_OCI:
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
before PHP-FPM sets it up). (Ingmar Runge)
- SPL:
. Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
(jhdxr)
- Standard:
. Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea)
31 Aug 2017 PHP 7.0.23
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
function eh(){}
set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
--EXPECT--
float(INF)
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #75252: Incorrect token formatting on two parse errors in one request
--FILE--
<?php
$code = <<<'CODE'
function test_missing_semicolon() : string {
$x = []
FOO
}
CODE;
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
--FILE--
<?php
var_dump((new ReflectionFunction('sin'))->getClosure());
var_dump(function ($someThing) {});
?>
--EXPECT--
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$number"]=>
string(10) "<required>"
}
}
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$someThing"]=>
string(10) "<required>"
}
}
+2
View File
@@ -896,6 +896,8 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* this should be compatible with the standard zenderror */
ZEND_COLD void zenderror(const char *error) /* {{{ */
{
CG(parse_error) = 0;
if (EG(exception)) {
/* An exception was thrown in the lexer, don't throw another in the parser. */
return;
-1
View File
@@ -297,7 +297,6 @@ ZEND_COLD void zenderror(const char *error);
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
extern ZEND_API zend_class_entry *zend_standard_class_def;
extern ZEND_API zend_utility_values zend_uv;
extern ZEND_API zval zval_used_for_init;
/* If DTrace is available and enabled */
extern ZEND_API zend_bool zend_dtrace_enabled;
+6 -3
View File
@@ -3067,7 +3067,8 @@ get_function_via_handler:
(!fcc->function_handler->common.scope ||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3237,7 +3238,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3324,7 +3326,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
+1 -1
View File
@@ -1203,7 +1203,7 @@ ZEND_FUNCTION(get_object_vars)
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);
zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
} else {
zend_symbtable_add_new(Z_ARRVAL_P(return_value), key, value);
zend_symtable_add_new(Z_ARRVAL_P(return_value), key, value);
}
}
}
+10 -3
View File
@@ -414,6 +414,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
@@ -446,9 +447,15 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zend_string *name;
zval info;
if (arg_info->name) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
((zend_internal_arg_info*)arg_info)->name);
}
} else {
name = zend_strpprintf(0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
+5 -1
View File
@@ -310,7 +310,7 @@ static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, cons
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
}
static zend_always_inline zval *zend_symbtable_add_new(HashTable *ht, zend_string *key, zval *pData)
static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
@@ -321,6 +321,10 @@ static zend_always_inline zval *zend_symbtable_add_new(HashTable *ht, zend_strin
}
}
/* This typo snuck into 7.0.17 and 7.1.3, this define exists for BC */
#define zend_symbtable_add_new(ht, key, pData) \
zend_symtable_add_new(ht, key, pData)
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
+3 -1
View File
@@ -221,8 +221,10 @@ try_again:
if (Z_TYPE(holder) == IS_LONG) { \
if (op == result) { \
zval_ptr_dtor(op); \
ZVAL_LONG(op, Z_LVAL(holder)); \
} else { \
(op) = &(holder); \
} \
(op) = &(holder); \
} \
break; \
} \
+4 -2
View File
@@ -219,8 +219,10 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
+15 -15
View File
@@ -2692,21 +2692,21 @@ EOF
else
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
fi
for arg in $clean_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
continue;
fi
echo "'[$]arg' \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'"
else
if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then
continue;
fi
echo "[$]arg \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg"
fi
CONFIGURE_ARGS="$clean_configure_args"
while test "X$CONFIGURE_ARGS" != "X";
do
if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"`
elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"`
CURRENT_ARG="'$CURRENT_ARG'"
else
break
fi
$as_echo "$CURRENT_ARG \\" >>$1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG"
done
echo '"[$]@"' >> $1
chmod +x $1
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=24
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=25
PHP_EXTRA_VERSION="RC1"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1 -1
View File
@@ -59,7 +59,7 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
bc_init_num(&temp);
/* Calculate it. */
bc_divide (num1, num2, &temp, scale);
bc_divide (num1, num2, &temp, 0);
if (quot)
quotient = bc_copy_num (temp);
bc_multiply (temp, num2, &temp, rscale);
+27 -12
View File
@@ -45,7 +45,7 @@
int
bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
{
bc_num power, exponent, parity, temp;
bc_num power, exponent, modulus, parity, temp;
int rscale;
/* Check for correct numbers. */
@@ -55,12 +55,16 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
/* Set initial values. */
power = bc_copy_num (base);
exponent = bc_copy_num (expo);
modulus = bc_copy_num (mod);
temp = bc_copy_num (BCG(_one_));
bc_init_num(&parity);
/* Check the base for scale digits. */
if (base->n_scale != 0)
if (power->n_scale != 0)
{
bc_rt_warn ("non-zero scale in base");
bc_divide (power, BCG(_one_), &power, 0); /*truncate */
}
/* Check the exponent for scale digits. */
if (exponent->n_scale != 0)
@@ -70,27 +74,38 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
}
/* Check the modulus for scale digits. */
if (mod->n_scale != 0)
if (modulus->n_scale != 0)
{
bc_rt_warn ("non-zero scale in modulus");
bc_divide (modulus, BCG(_one_), &modulus, 0); /*truncate */
}
/* Do the calculation. */
rscale = MAX(scale, base->n_scale);
while ( !bc_is_zero(exponent) )
rscale = MAX(scale, power->n_scale);
if ( !bc_compare(modulus, BCG(_one_)) )
{
(void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
if ( !bc_is_zero(parity) )
temp = bc_new_num (1, scale);
}
else
{
while ( !bc_is_zero(exponent) )
{
bc_multiply (temp, power, &temp, rscale);
(void) bc_modulo (temp, mod, &temp, scale);
}
(void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
if ( !bc_is_zero(parity) )
{
bc_multiply (temp, power, &temp, rscale);
(void) bc_modulo (temp, modulus, &temp, scale);
}
bc_multiply (power, power, &power, rscale);
(void) bc_modulo (power, mod, &power, scale);
bc_multiply (power, power, &power, rscale);
(void) bc_modulo (power, modulus, &power, scale);
}
}
/* Assign the value. */
bc_free_num (&power);
bc_free_num (&exponent);
bc_free_num (&modulus);
bc_free_num (result);
bc_free_num (&parity);
*result = temp;
+3
View File
@@ -105,5 +105,8 @@ bc_str2num (bc_num *num, char *str, int scale)
for (;strscale > 0; strscale--)
*nptr++ = CH_VAL(*ptr++);
}
if (bc_is_zero (*num))
(*num)->n_sign = PLUS;
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #44995 (bcpowmod() fails if scale != 0)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
?>
--FILE--
<?php
var_dump(bcpowmod('4', '4', '3', 1));
var_dump(bcpowmod('3234', '32345', '22345', 1));
?>
===DONE===
--EXPECT--
string(3) "1.0"
string(7) "17334.0"
===DONE===
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #46781 (BC math handles minus zero incorrectly)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
?>
--FILE--
<?php
var_dump(bcadd('-0.0', '-0.0', 1));
var_dump(bccomp('-0.0', '0', 1));
?>
===DONE===
--EXPECT--
string(3) "0.0"
int(0)
===DONE===
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #54598 (bcpowmod() may return 1 if modulus is 1)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
?>
--FILE--
<?php
var_dump(bcpowmod(5, 0, 1));
var_dump(bcpowmod(5, 0, 1, 3));
?>
===DONE===
--EXPECT--
string(1) "0"
string(5) "0.000"
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip valid only for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
--EXPECT--
string(5) "1.000"
string(5) "1.000"
===DONE===
bc math warning: non-zero scale in base
bc math warning: non-zero scale in modulus
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
--EXPECT--
bc math warning: non-zero scale in base
string(5) "1.000"
bc math warning: non-zero scale in modulus
string(5) "1.000"
===DONE===
+3
View File
@@ -73,6 +73,8 @@ if test "$PHP_CURL" != "no"; then
save_CFLAGS="$CFLAGS"
CFLAGS="`$CURL_CONFIG --cflags`"
save_LDFLAGS="$LDFLAGS"
LDFLAGS="`$CURL_CONFIG --libs`"
AC_PROG_CPP
AC_MSG_CHECKING([for openssl support in libcurl])
@@ -130,6 +132,7 @@ int main(int argc, char *argv[])
])
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
else
AC_MSG_RESULT([no])
fi
+37 -1
View File
@@ -647,6 +647,7 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot);
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
@@ -910,6 +911,7 @@ PHP_MINFO_FUNCTION(date)
php_info_print_table_start();
php_info_print_table_row(2, "date/time support", "enabled");
php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
@@ -2116,7 +2118,7 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_interval.read_property = date_interval_read_property;
date_object_handlers_interval.write_property = date_interval_write_property;
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
date_object_handlers_interval.get_property_ptr_ptr = NULL;
date_object_handlers_interval.get_property_ptr_ptr = date_interval_get_property_ptr_ptr;
date_object_handlers_interval.get_gc = date_object_get_gc_interval;
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
@@ -4141,6 +4143,40 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
}
/* }}} */
/* {{{ date_interval_get_property_ptr_ptr */
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
zval tmp_member, *ret;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
cache_slot = NULL;
}
if(zend_binary_strcmp("y", sizeof("y") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("m", sizeof("m") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("d", sizeof("d") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
/* Fallback to read_property. */
ret = NULL;
} else {
ret = (zend_get_std_object_handlers())->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
zval_dtor(member);
}
return ret;
}
/* }}} */
/* {{{ proto DateInterval::__construct([string interval_spec])
Creates new DateInterval object.
@@ -0,0 +1,16 @@
--TEST--
Test DateInterval props with dimension handling
--FILE--
<?php
class Z extends DateInterval{}
$z = new Z('P2Y4DT6H8M');
$i = 0;
$z->prop[1]=10;
while ($i < 1026) {
$z->prop[$i] = $i;
$i++;
}
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
+1 -1
View File
@@ -5,7 +5,7 @@ Test 5: HTML Test
--FILE--
<?php
$dom = new domdocument;
$dom->loadHTMLFile(dirname(__FILE__)."/test.html");
$dom->loadHTMLFile(dirname(__FILE__)."/test.html", LIBXML_NOBLANKS);
print "--- save as XML\n";
print adjustDoctype($dom->saveXML());
+7
View File
@@ -53,12 +53,17 @@ int gdImageGrayScale(gdImagePtr src)
int new_pxl, pxl;
typedef int (*FuncPtr)(gdImagePtr, int, int);
FuncPtr f;
int alpha_blending;
f = GET_PIXEL_FUNCTION(src);
if (src==NULL) {
return 0;
}
alpha_blending = src->alphaBlendingFlag;
gdImageAlphaBlending(src, gdEffectReplace);
for (y=0; y<src->sy; ++y) {
for (x=0; x<src->sx; ++x) {
pxl = f (src, x, y);
@@ -75,6 +80,8 @@ int gdImageGrayScale(gdImagePtr src)
gdImageSetPixel (src, x, y, new_pxl);
}
}
gdImageAlphaBlending(src, alpha_blending);
return 1;
}
+2 -2
View File
@@ -1783,8 +1783,8 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
const gdFixed f_slop_y = f_sin;
const gdFixed f_slop_x = f_cos;
const gdFixed f_slop = f_slop_x > 0 && f_slop_x > 0 ?
f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y)
const gdFixed f_slop = f_slop_x > 0 && f_slop_y > 0 ?
(f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y))
: 0;
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #75124 (gdImageGrayScale() may produce colors)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<')) {
die('skip only for bundled libgd or external libgd >= 2.2.5');
}
?>
--FILE--
<?php
$im = imagecreatefrompng(__DIR__ . '/bug75124.png');
var_dump(imageistruecolor($im));
imagefilter($im, IMG_FILTER_GRAYSCALE);
for ($i = 0, $width = imagesx($im); $i < $width; $i ++) {
for ($j = 0, $height = imagesy($im); $j < $height; $j++) {
$color = imagecolorat($im, $i, $j);
$red = ($color >> 16) & 0xff;
$green = ($color >> 8) & 0xff;
$blue = $color & 0xff;
if ($red != $green || $green != $blue) {
echo "non grayscale pixel detected\n";
break 2;
}
}
}
?>
===DONE===
--EXPECT--
bool(true)
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+4 -4
View File
@@ -161,16 +161,16 @@ PHP_MINFO_FUNCTION(php_gettext)
Set the textdomain to "domain". Returns the current domain */
PHP_NAMED_FUNCTION(zif_textdomain)
{
char *domain, *domain_name, *retval;
size_t domain_len;
char *domain = NULL, *domain_name, *retval;
size_t domain_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &domain, &domain_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &domain, &domain_len) == FAILURE) {
return;
}
PHP_GETTEXT_DOMAIN_LENGTH_CHECK
if (strcmp(domain, "") && strcmp(domain, "0")) {
if (domain != NULL && strcmp(domain, "") && strcmp(domain, "0")) {
domain_name = domain;
} else {
domain_name = NULL;
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #73730 (textdomain(null) throws in strict mode)
--SKIPIF--
<?php
if (!extension_loaded('gettext')) die('skip gettext extension is not available');
?>
--FILE--
<?php
declare(strict_types=1);
var_dump(textdomain(null));
?>
===DONE===
--EXPECT--
string(8) "messages"
===DONE===
+11 -11
View File
@@ -477,17 +477,6 @@ void calendar_register_IntlCalendar_class(void)
Calendar_handlers.dtor_obj = Calendar_objects_dtor;
Calendar_handlers.free_obj = Calendar_objects_free;
/* Create and register 'IntlGregorianCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions);
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
Calendar_ce_ptr);
if (!GregorianCalendar_ce_ptr) {
//can't happen know without bigger problems before
php_error_docref0(NULL, E_ERROR,
"IntlGregorianCalendar: class registration has failed.");
return;
}
/* Declare 'IntlCalendar' class constants */
#define CALENDAR_DECL_LONG_CONST(name, val) \
zend_declare_class_constant_long(Calendar_ce_ptr, name, sizeof(name) - 1, \
@@ -541,5 +530,16 @@ void calendar_register_IntlCalendar_class(void)
CALENDAR_DECL_LONG_CONST("WALLTIME_LAST", UCAL_WALLTIME_LAST);
CALENDAR_DECL_LONG_CONST("WALLTIME_NEXT_VALID", UCAL_WALLTIME_NEXT_VALID);
#endif
/* Create and register 'IntlGregorianCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions);
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
Calendar_ce_ptr);
if (!GregorianCalendar_ce_ptr) {
//can't happen know without bigger problems before
php_error_docref0(NULL, E_ERROR,
"IntlGregorianCalendar: class registration has failed.");
return;
}
}
/* }}} */
+6 -2
View File
@@ -59,8 +59,12 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2)
zval norm1, norm2;
zval *num1_p = NULL, *num2_p = NULL;
zval *norm1_p = NULL, *norm2_p = NULL;
zval* str1_p = collator_convert_object_to_string( op1, &str1 );
zval* str2_p = collator_convert_object_to_string( op2, &str2 );
zval *str1_p, *str2_p;
ZVAL_NULL(&str1);
str1_p = collator_convert_object_to_string( op1, &str1 );
ZVAL_NULL(&str2);
str2_p = collator_convert_object_to_string( op2, &str2 );
/* If both args are strings AND either of args is not numeric string
* then use ICU-compare. Otherwise PHP-compare. */
+1 -1
View File
@@ -897,7 +897,7 @@ static PHP_METHOD(UConverter, getAvailable) {
/* }}} */
/* {{{ proto array UConverter::getAliases(string name) */
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getAliases) {
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #75090 Constants of parent IntlCalendar class not inherited
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
class Foo extends IntlCalendar {}
$fooRef = new ReflectionClass(Foo::class);
$intlGregorianCalendarRef = new ReflectionClass(IntlGregorianCalendar::class);
$intlCalendarRef = new ReflectionClass(IntlCalendar::class);
var_dump(
count($fooRef->getConstants()) === count($intlCalendarRef->getConstants()),
count($intlGregorianCalendarRef->getConstants()) === count($intlCalendarRef->getConstants())
);
?>
===DONE===
--EXPECT--
bool(true)
bool(true)
===DONE===
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #75193 segfault in collator_convert_object_to_string
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
$a = new \Collator('en_US');
$b = [new stdclass, new stdclass];
var_dump($a->sort($b));
?>
===DONE===
--EXPECT--
bool(true)
===DONE===
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #75318 (The parameter of UConverter::getAliases() is not optional)
--SKIP--
<?php
if (!extension_loaded('intl')) die('skip intl extension is not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod('UConverter', 'getAliases');
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(1)
===DONE===
+1
View File
@@ -1546,3 +1546,4 @@ xmlXPtrRangeToFunction
xmlXPtrWrapLocationSet
xmlBufContent
xmlBufUse
xmlBufferDetach
+6 -4
View File
@@ -1402,6 +1402,8 @@ void php_oci_define_hash_dtor(zval *data)
define->name = NULL;
}
zval_ptr_dtor(&define->val);
efree(define);
}
/* }}} */
@@ -1414,9 +1416,9 @@ void php_oci_bind_hash_dtor(zval *data)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
if (!Z_ISUNDEF(bind->parameter)) {
zval_ptr_dtor(&bind->parameter);
ZVAL_UNDEF(&bind->parameter);
if (!Z_ISUNDEF(bind->val)) {
zval_ptr_dtor(&bind->val);
ZVAL_UNDEF(&bind->val);
}
if (bind->array.elements) {
@@ -2642,7 +2644,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (placeholder == NULL) {
placeholder = return_value;
} else {
zval_dtor(placeholder);
zval_ptr_dtor(placeholder);
}
array_init(placeholder);
+4 -4
View File
@@ -75,10 +75,10 @@ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_even
ZVAL_NULL(&params[0]);
/* Cleanup */
zval_dtor(&retval);
zval_dtor(&params[0]);
zval_dtor(&params[1]);
zval_dtor(&params[2]);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&params[1]);
zval_ptr_dtor(&params[2]);
return returnValue;
}
+5 -4
View File
@@ -117,7 +117,7 @@ PHP_FUNCTION(oci_define_by_name)
php_oci_define *define;
zend_string *zvtmp;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
return;
}
@@ -153,7 +153,8 @@ PHP_FUNCTION(oci_define_by_name)
define->name[name_len] = '\0';
define->name_len = (ub4) name_len;
define->type = (ub4) type;
define->zval = var;
ZEND_ASSERT(Z_ISREF_P(var));
ZVAL_COPY(&define->val, var);
RETURN_TRUE;
}
@@ -202,7 +203,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rszl|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
return;
}
@@ -1439,7 +1440,7 @@ PHP_FUNCTION(oci_fetch_all)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
zval_dtor(array);
zval_ptr_dtor(array);
while (skip--) {
if (php_oci_statement_fetch(statement, nrows)) {
+85 -66
View File
@@ -364,8 +364,10 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
continue;
}
zval_dtor(column->define->zval);
php_oci_column_to_zval(column, column->define->zval, 0);
ZEND_ASSERT(Z_ISREF(column->define->val));
zval_ptr_dtor(Z_REFVAL(column->define->val));
ZVAL_NULL(Z_REFVAL(column->define->val));
php_oci_column_to_zval(column, Z_REFVAL(column->define->val), 0);
}
return 0;
@@ -910,10 +912,12 @@ void php_oci_statement_free(php_oci_statement *statement)
int php_oci_bind_pre_exec(zval *data, void *result)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
zval *zv = &bind->val;
*(int *)result = 0;
if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
ZVAL_DEREF(zv);
if (Z_TYPE_P(zv) == IS_ARRAY) {
/* These checks are currently valid for oci_bind_by_name, not
* oci_bind_array_by_name. Also bind->type and
* bind->indicator are not used for oci_bind_array_by_name.
@@ -927,7 +931,7 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_CLOB:
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE_P(bind->zval) != IS_OBJECT) {
if (Z_TYPE_P(zv) != IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -943,14 +947,14 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_LBI:
case SQLT_BIN:
case SQLT_LNG:
if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) {
if (Z_TYPE_P(zv) == IS_RESOURCE || Z_TYPE_P(zv) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
if (Z_TYPE_P(bind->zval) != IS_RESOURCE) {
if (Z_TYPE_P(zv) != IS_RESOURCE) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -971,30 +975,34 @@ int php_oci_bind_post_exec(zval *data)
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
php_oci_connection *connection = bind->parent_statement->connection;
sword errstatus;
zval *zv = &bind->val;
ZVAL_DEREF(zv);
if (bind->indicator == -1) { /* NULL */
zval *val = bind->zval;
if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
if (Z_TYPE_P(zv) == IS_STRING) {
*Z_STRVAL_P(zv) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);
ZVAL_NULL(val);
} else if (Z_TYPE_P(bind->zval) == IS_STRING
&& Z_STRLEN_P(bind->zval) > 0
&& Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
zval_ptr_dtor(zv);
ZVAL_NULL(zv);
} else if (Z_TYPE_P(zv) == IS_STRING
&& Z_STRLEN_P(zv) > 0
&& Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] != '\0') {
/* The post- PHP 5.3 feature for "interned" strings disallows
* their reallocation but (i) any IN binds either interned or
* not should already be null terminated and (ii) for OUT
* binds, php_oci_bind_out_callback() should have allocated a
* new string that we can modify here.
*/
Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
} else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
SEPARATE_STRING(zv);
Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0);
Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0';
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
int i;
zval *entry = NULL;
HashTable *hash = HASH_OF(bind->zval);
HashTable *hash;
SEPARATE_ARRAY(zv);
hash = HASH_OF(zv);
zend_hash_internal_pointer_reset(hash);
switch (bind->array.type) {
@@ -1003,22 +1011,22 @@ int php_oci_bind_post_exec(zval *data)
case SQLT_LNG:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_long(bind->zval, ((oci_phpsized_int *)(bind->array.elements))[i]);
add_next_index_long(zv, ((oci_phpsized_int *)(bind->array.elements))[i]);
}
}
break;
case SQLT_FLT:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
add_next_index_double(zv, ((double *)(bind->array.elements))[i]);
}
}
break;
@@ -1031,7 +1039,7 @@ int php_oci_bind_post_exec(zval *data)
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
zval_dtor(entry);
zval_ptr_dtor(entry);
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
@@ -1047,10 +1055,10 @@ int php_oci_bind_post_exec(zval *data)
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(bind->zval);
add_next_index_null(zv);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
add_next_index_stringl(bind->zval, (char *)buff, buff_len);
add_next_index_stringl(zv, (char *)buff, buff_len);
}
}
}
@@ -1066,20 +1074,21 @@ int php_oci_bind_post_exec(zval *data)
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
int curr_element_length = bind->array.element_lengths[i];
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
zend_hash_move_forward(hash);
} else {
add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
add_next_index_stringl(zv, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
}
}
break;
}
} else if ((Z_TYPE_P(bind->zval) == IS_TRUE) || (Z_TYPE_P(bind->zval) == IS_FALSE)) {
if (Z_LVAL_P(bind->zval) == 0)
ZVAL_BOOL(bind->zval, FALSE);
else if (Z_LVAL_P(bind->zval) == 1)
ZVAL_BOOL(bind->zval, TRUE);
} else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) {
/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temorary value) */
if (Z_LVAL_P(zv) == 0)
ZVAL_BOOL(zv, FALSE);
else if (Z_LVAL_P(zv) == 1)
ZVAL_BOOL(zv, TRUE);
}
return 0;
@@ -1103,11 +1112,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
sword errstatus;
zval *param = NULL;
if (!Z_ISREF_P(var)) {
param = var;
} else {
param = Z_REFVAL_P(var);
}
ZEND_ASSERT(Z_ISREF_P(var));
param = Z_REFVAL_P(var);
switch (type) {
case SQLT_NTY:
@@ -1242,9 +1248,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
bindp = old_bind;
if (!Z_ISUNDEF(bindp->parameter)) {
zval_ptr_dtor(&bindp->parameter);
ZVAL_UNDEF(&bindp->parameter);
if (!Z_ISUNDEF(bindp->val)) {
zval_ptr_dtor(&bindp->val);
ZVAL_UNDEF(&bindp->val);
}
} else {
zend_string *zvtmp;
@@ -1254,9 +1260,6 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
zend_string_release(zvtmp);
}
/* Keep a copy of bound variable in the bind hash */
ZVAL_COPY(&bindp->parameter, var);
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
* when both in/out parameters are bound with empty strings
*/
@@ -1266,7 +1269,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
bindp->parent_statement = statement;
bindp->zval = param;
ZVAL_COPY(&bindp->val, var);
bindp->type = type;
/* Storing max length set in OCIBindByName() to check it later in
* php_oci_bind_in_callback() function to avoid ORA-1406 error while
@@ -1360,11 +1363,14 @@ sb4 php_oci_bind_in_callback(
php_oci_bind *phpbind;
zval *val;
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) {
if (!(phpbind=(php_oci_bind *)ictxp) || Z_ISUNDEF(phpbind->val)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_ISNULL_P(val)) {
/* we're going to insert a NULL column */
phpbind->indicator = -1;
@@ -1421,11 +1427,14 @@ sb4 php_oci_bind_out_callback(
zval *val;
sb4 retval = OCI_ERROR;
if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) {
if (!(phpbind=(php_oci_bind *)octxp) || Z_ISUNDEF(phpbind->val)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_TYPE_P(val) == IS_RESOURCE) {
/* Processing for ref-cursor out binds */
if (phpbind->statement != NULL) {
@@ -1463,7 +1472,7 @@ sb4 php_oci_bind_out_callback(
retval = OCI_CONTINUE;
} else {
convert_to_string(val);
zval_dtor(val);
zval_ptr_dtor(val);
{
char *p = ecalloc(1, PHP_OCI_PIECE_SIZE);
@@ -1474,12 +1483,12 @@ sb4 php_oci_bind_out_callback(
Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(val) + 1);
/* XXX is this right? */
ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
ZVAL_STRINGL(val, NULL, Z_STRLEN(val) + 1);
#endif
/* XXX we assume that zend-zval len has 4 bytes */
*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
*bufpp = Z_STRVAL_P(phpbind->zval);
*alenpp = (ub4*) &Z_STRLEN_P(val);
*bufpp = Z_STRVAL_P(val);
*piecep = OCI_ONE_PIECE;
*rcodepp = &phpbind->retcode;
*indpp = &phpbind->indicator;
@@ -1527,10 +1536,10 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
if (!column) {
php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", Z_LVAL(tmp));
zval_dtor(&tmp);
zval_ptr_dtor(&tmp);
return NULL;
}
zval_dtor(&tmp);
zval_ptr_dtor(&tmp);
}
return column;
}
@@ -1586,11 +1595,15 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
Bind arrays to PL/SQL types */
int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
{
php_oci_bind *bind, *bindp;
php_oci_bind *bind;
sword errstatus;
zend_string *zvtmp;
zval *val;
convert_to_array(var);
ZEND_ASSERT(Z_ISREF_P(var));
val = Z_REFVAL_P(var);
SEPARATE_ZVAL_NOREF(val);
convert_to_array(val);
if (maxlength < -1) {
php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength);
@@ -1601,11 +1614,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_NUM:
case SQLT_INT:
case SQLT_LNG:
bind = php_oci_bind_array_helper_number(var, max_table_length);
bind = php_oci_bind_array_helper_number(val, max_table_length);
break;
case SQLT_FLT:
bind = php_oci_bind_array_helper_double(var, max_table_length);
bind = php_oci_bind_array_helper_double(val, max_table_length);
break;
case SQLT_AFC:
@@ -1614,14 +1627,14 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_AVC:
case SQLT_STR:
case SQLT_LVC:
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(val)) == 0) {
php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
return 1;
}
bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
bind = php_oci_bind_array_helper_string(val, max_table_length, maxlength);
break;
case SQLT_ODT:
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
bind = php_oci_bind_array_helper_date(val, max_table_length, statement->connection);
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type);
@@ -1638,7 +1651,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
bind->statement = NULL;
bind->parent_statement = statement;
bind->bind = NULL;
bind->zval = var;
ZVAL_COPY(&bind->val, var);
bind->array.type = type;
bind->indicator = 0; /* not used for array binds */
bind->type = 0; /* not used for array binds */
@@ -1677,6 +1690,8 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
efree(bind->array.indicators);
}
zval_ptr_dtor(&bind->val);
efree(bind);
statement->errcode = php_oci_error(statement->err, errstatus);
@@ -1690,7 +1705,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
}
zvtmp = zend_string_init(name, name_len, 0);
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bind);
zend_hash_update_ptr(statement->binds, zvtmp, bind);
zend_string_release(zvtmp);
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
@@ -1707,6 +1722,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
if (maxlength == -1) {
@@ -1723,7 +1739,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
}
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1780,10 +1796,11 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1820,10 +1837,11 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1861,10 +1879,11 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
zval *entry;
sword errstatus;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.7"
#define PHP_OCI8_VERSION "2.1.8"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+2 -3
View File
@@ -209,7 +209,7 @@ typedef struct {
/* {{{ php_oci_define */
typedef struct {
zval *zval; /* zval used in define */
zval val; /* zval used in define */
text *name; /* placeholder's name */
ub4 name_len; /* placeholder's name length */
ub4 type; /* define type */
@@ -244,8 +244,7 @@ typedef struct {
/* {{{ php_oci_bind */
typedef struct {
OCIBind *bind; /* bind handle */
zval *zval; /* value */
zval parameter; /* a copy of bound variable used for oci_bind_by_name */
zval val; /* value */
dvoid *descriptor; /* used for binding of LOBS etc */
OCIStmt *statement; /* used for binding REFCURSORs */
php_oci_statement *parent_statement; /* pointer to the parent statement */
+6 -1
View File
@@ -7272,7 +7272,12 @@ for (;; ptr++)
so far in order to get the number. If the name is not found, leave
the value of recno as 0 for a forward reference. */
else
/* This patch (removing "else") fixes a problem when a reference is
to multiple identically named nested groups from within the nest.
Once again, it is not the "proper" fix, and it results in an
over-allocation of memory. */
/* else */
{
ng = cd->named_groups;
for (i = 0; i < cd->names_found; i++, ng++)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
CVE-2016-1283, see bug #75207
--FILE--
<?php
preg_match("/š(?:F?+(?:^(?(R)a+\"){99}-))(?J)(?'R'(?'R'<((?'RR'(?'R'\){97)?J)?J)(?'R'(?'R'\){99|(:(?|(?'R')(\k'R')|((?'R')))H'R'R)(H'R))))))/", "*b\dc");
?>
==DONE==
--EXPECTF--
Warning: preg_match(): Compilation failed: unmatched parentheses at offset %d in %s on line %d
==DONE==
+48 -7
View File
@@ -29,6 +29,9 @@
#include "pdo/php_pdo_driver.h"
#include "php_pdo_oci.h"
#include "php_pdo_oci_int.h"
#ifdef ZTS
#include <TSRM/TSRM.h>
#endif
/* {{{ pdo_oci_functions[] */
const zend_function_entry pdo_oci_functions[] = {
@@ -52,7 +55,7 @@ zend_module_entry pdo_oci_module_entry = {
pdo_oci_functions,
PHP_MINIT(pdo_oci),
PHP_MSHUTDOWN(pdo_oci),
NULL,
PHP_RINIT(pdo_oci),
NULL,
PHP_MINFO(pdo_oci),
PHP_PDO_OCI_VERSION,
@@ -82,29 +85,67 @@ const ub4 PDO_OCI_INIT_MODE =
/* true global environment */
OCIEnv *pdo_oci_Env = NULL;
#ifdef ZTS
/* lock for pdo_oci_Env initialization */
static MUTEX_T pdo_oci_env_mutex;
#endif
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(pdo_oci)
{
php_pdo_register_driver(&pdo_oci_driver);
#if HAVE_OCIENVCREATE
OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL);
#else
OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL);
// Defer OCI init to PHP_RINIT_FUNCTION because with php-fpm,
// NLS_LANG is not yet available here.
#ifdef ZTS
pdo_oci_env_mutex = tsrm_mutex_alloc();
#endif
return SUCCESS;
}
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(pdo_oci)
{
if (!pdo_oci_Env) {
#ifdef ZTS
tsrm_mutex_lock(pdo_oci_env_mutex);
if (!pdo_oci_Env) { // double-checked locking idiom
#endif
#if HAVE_OCIENVCREATE
OCIEnvCreate(&pdo_oci_Env, PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL, 0, NULL);
#else
OCIInitialize(PDO_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
OCIEnvInit(&pdo_oci_Env, OCI_DEFAULT, 0, NULL);
#endif
#ifdef ZTS
}
tsrm_mutex_unlock(pdo_oci_env_mutex);
#endif
}
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(pdo_oci)
{
php_pdo_unregister_driver(&pdo_oci_driver);
OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV);
if (pdo_oci_Env) {
OCIHandleFree((dvoid*)pdo_oci_Env, OCI_HTYPE_ENV);
}
#ifdef ZTS
tsrm_mutex_free(pdo_oci_env_mutex);
#endif
return SUCCESS;
}
/* }}} */
+1
View File
@@ -20,6 +20,7 @@ Version => %s
date
date/time support => enabled
timelib version => %s
"Olson" Timezone Database Version => %s
Timezone Database => %s
Default timezone => %s
+1 -3
View File
@@ -42,7 +42,5 @@ array(1) {
array(0) {
}
Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d
Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in %s on line %d
Warning: SimpleXMLElement::xpath(): Invalid expression in %s on line %d%A
bool(false)
+1
View File
@@ -3,6 +3,7 @@ Bug #74950 (null pointer deref in zim_simplexml_element_getDocNamespaces)
--SKIPIF--
<?php
if (!extension_loaded("simplexml")) die("skip SimpleXML not available");
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
?>
--FILE--
<?php
+1 -1
View File
@@ -733,7 +733,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
return;
}
intern->flags = value & SPL_DLLIST_IT_MASK;
intern->flags = (value & SPL_DLLIST_IT_MASK) | (intern->flags & SPL_DLLIST_IT_FIX);
RETURN_LONG(intern->flags);
}
+1 -1
View File
@@ -3384,7 +3384,7 @@ SPL_METHOD(AppendIterator, append)
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &it, zend_ce_iterator) == FAILURE) {
return;
}
if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) == SUCCESS) {
if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) == SUCCESS && spl_dual_it_valid(intern) != SUCCESS) {
spl_array_iterator_append(&intern->u.append.zarrayit, it);
intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator);
}else{
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
--FILE--
<?php
$q = new SplQueue();
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
} catch (Exception $e) {
echo 'unexpected exception: ' . $e->getMessage() . "\n";
}
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
} catch (Exception $e) {
echo 'expected exception: ' . $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECTF--
expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen
===DONE===
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75173 incorrect behavior of AppendIterator::append in foreach loop
--FILE--
<?php
$it = new \AppendIterator();
$it->append(new ArrayIterator(['foo']));
foreach ($it as $item) {
var_dump($item);
if ('foo' === $item) {
$it->append(new ArrayIterator(['bar']));
}
}
--EXPECT--
string(3) "foo"
string(3) "bar"
+1 -1
View File
@@ -85,11 +85,11 @@ if test $PHP_SQLITE3 != "no"; then
other_flags="$other_flags -DSQLITE_ENABLE_ICU=1"
fi
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
PHP_SQLITE3_CFLAGS="-I@ext_srcdir@/libsqlite $other_flags $threadsafe_flags $debug_flags"
PHP_INSTALL_HEADERS([ext/sqlite3/libsqlite/sqlite3.h])
fi
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
AC_DEFINE(HAVE_SQLITE3,1,[ ])
sqlite3_sources="sqlite3.c $sqlite3_extra_sources"
+2 -2
View File
@@ -131,13 +131,13 @@ static zend_string *php_gethostbyname(char *name);
Get the host name of the current machine */
PHP_FUNCTION(gethostname)
{
char buf[HOST_NAME_MAX];
char buf[HOST_NAME_MAX + 1];
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (gethostname(buf, sizeof(buf) - 1)) {
if (gethostname(buf, sizeof(buf))) {
php_error_docref(NULL, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno));
RETURN_FALSE;
}
+1 -1
View File
@@ -314,7 +314,7 @@ PHP_FUNCTION(stream_socket_get_name)
RETURN_FALSE;
}
if (!ZSTR_LEN(name)) {
if ((ZSTR_LEN(name) == 0) || (ZSTR_VAL(name)[0] == 0)) {
zend_string_release(name);
RETURN_FALSE;
}
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #75220 (is_callable crash for 'parent')
--FILE--
<?php
$a = new A();
$a->bar('foo');
class B {};
class A extends B
{
function bar($func)
{
var_dump('foo');
var_dump(is_callable('parent::foo'));
var_dump(is_callable(array('parent', 'foo')));
}
function __call($func, $args)
{
}
};
?>
--EXPECT--
string(3) "foo"
bool(false)
bool(false)
+1 -1
View File
@@ -5,5 +5,5 @@ Bug #74103: heap-use-after-free when unserializing invalid array size
var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:00009617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}'));
?>
--EXPECTF--
Notice: unserialize(): Error at offset 68 of 100 bytes in %s on line %d
Notice: unserialize(): Error at offset %d of %d bytes in %s on line %d
bool(false)
@@ -7,15 +7,15 @@ var_dump(substr_compare("abcde", "df", -2) < 0);
var_dump(substr_compare("abcde", "bc", 1, 2));
var_dump(substr_compare("abcde", "bcg", 1, 2));
var_dump(substr_compare("abcde", "BC", 1, 2, true));
var_dump(substr_compare("abcde", "bc", 1, 3));
var_dump(substr_compare("abcde", "cd", 1, 2));
var_dump(substr_compare("abcde", "bc", 1, 3) > 0);
var_dump(substr_compare("abcde", "cd", 1, 2) < 0);
var_dump(substr_compare("abcde", "abc", 5, 1));
var_dump(substr_compare("abcde", "abcdef", -10, 10));
var_dump(substr_compare("abcde", "abcdef", -10, 10) < 0);
var_dump(substr_compare("abcde", "abc", 0, 0));
var_dump(substr_compare("abcde", -1, 0, NULL, new stdClass));
echo "Test\n";
var_dump(substr_compare("abcde", "abc", 0, -1));
var_dump(substr_compare("abcde", "abc", -1, NULL, -5));
var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0);
var_dump(substr_compare("abcde", -1, 0, "str", new stdClass));
echo "Done\n";
@@ -25,12 +25,12 @@ bool(true)
int(0)
int(0)
int(0)
int(1)
int(-1)
bool(true)
bool(true)
Warning: substr_compare(): The start position cannot exceed initial string length in %s on line %d
bool(false)
int(-1)
bool(true)
int(0)
Warning: substr_compare() expects parameter 5 to be boolean, object given in %s on line %d
@@ -39,7 +39,7 @@ Test
Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d
bool(false)
int(4)
bool(true)
Warning: substr_compare() expects parameter 4 to be integer, string given in %s on line %d
bool(false)
+2 -2
View File
@@ -38,11 +38,11 @@ Done
--EXPECTF--
Test
Internal errors TRUE
Internal: Specification mandate value for attribute att
Internal: Specification mandate%A value for attribute att
Internal errors FALSE
Warning: XMLReader::read(): %s: parser error : Specification mandate value for attribute att in %s on line %d
Warning: XMLReader::read(): %s: parser error : Specification mandate%A value for attribute att in %s on line %d
Warning: XMLReader::read(): <root att/> in %s on line %d
+1
View File
@@ -6,6 +6,7 @@ require_once dirname(__FILE__) .'/skipif.inc';
$proc = new xsltprocessor;
if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');
if (LIBXSLT_VERSION < 10117) die('skip too old libxsl');
if (LIBXSLT_VERSION > 10129) die('skip for libxsl < 10130');
?>
--FILE--
<?php
+206
View File
@@ -0,0 +1,206 @@
--TEST--
Test 10: EXSLT Support
--SKIPIF--
<?php
require_once dirname(__FILE__) .'/skipif.inc';
$proc = new xsltprocessor;
if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');
if (LIBXSLT_VERSION < 10130) die('skip too old libxsl');
?>
--FILE--
<?php
echo "Test 10: EXSLT Support";
$dom = new domDocument();
$dom->load(dirname(__FILE__)."/exslt.xsl");
$proc = new xsltprocessor;
$xsl = $proc->importStylesheet($dom);
$xml = new DomDocument();
$xml->load(dirname(__FILE__)."/exslt.xml");
print $proc->transformToXml($xml);
--EXPECT--
Test 10: EXSLT Support
Test Date : 0001-12-31Z
year : 1
leap-year : false
month-in-year : 12
month-name : December
month-abbreviation : Dec
week-in-year : 1
day-in-year : 365
day-in-month : 31
day-of-week-in-month : 5
day-in-week : 2
day-name : Monday
day-abbreviation : Mon
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 3000-01-31
year : 3000
leap-year : false
month-in-year : 1
month-name : January
month-abbreviation : Jan
week-in-year : 5
day-in-year : 31
day-in-month : 31
day-of-week-in-month : 5
day-in-week : 6
day-name : Friday
day-abbreviation : Fri
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 2000-02-29
year : 2000
leap-year : true
month-in-year : 2
month-name : February
month-abbreviation : Feb
week-in-year : 9
day-in-year : 60
day-in-month : 29
day-of-week-in-month : 5
day-in-week : 3
day-name : Tuesday
day-abbreviation : Tue
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 9990001-12-31Z
year : 9990001
leap-year : false
month-in-year : 12
month-name : December
month-abbreviation : Dec
week-in-year : 1
day-in-year : 365
day-in-month : 31
day-of-week-in-month : 5
day-in-week : 2
day-name : Monday
day-abbreviation : Mon
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : -0004-02-29
year : NaN
leap-year : NaN
month-in-year : NaN
month-name :
month-abbreviation :
week-in-year : NaN
day-in-year : NaN
day-in-month : NaN
day-of-week-in-month : NaN
day-in-week : NaN
day-name :
day-abbreviation :
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 1999-01-02
year : 1999
leap-year : false
month-in-year : 1
month-name : January
month-abbreviation : Jan
week-in-year : 53
day-in-year : 2
day-in-month : 2
day-of-week-in-month : 1
day-in-week : 7
day-name : Saturday
day-abbreviation : Sat
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 1999-01-03
year : 1999
leap-year : false
month-in-year : 1
month-name : January
month-abbreviation : Jan
week-in-year : 53
day-in-year : 3
day-in-month : 3
day-of-week-in-month : 1
day-in-week : 1
day-name : Sunday
day-abbreviation : Sun
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 2004-01-01
year : 2004
leap-year : true
month-in-year : 1
month-name : January
month-abbreviation : Jan
week-in-year : 1
day-in-year : 1
day-in-month : 1
day-of-week-in-month : 1
day-in-week : 5
day-name : Thursday
day-abbreviation : Thu
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 2006-01-01
year : 2006
leap-year : false
month-in-year : 1
month-name : January
month-abbreviation : Jan
week-in-year : 52
day-in-year : 1
day-in-month : 1
day-of-week-in-month : 1
day-in-week : 1
day-name : Sunday
day-abbreviation : Sun
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
Test Date : 2007-12-31
year : 2007
leap-year : false
month-in-year : 12
month-name : December
month-abbreviation : Dec
week-in-year : 1
day-in-year : 365
day-in-month : 31
day-of-week-in-month : 5
day-in-week : 2
day-name : Monday
day-abbreviation : Mon
time :
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
+32 -7
View File
@@ -92,6 +92,8 @@
#include "SAPI.h"
#include "rfc1867.h"
#include "ext/standard/html_tables.h"
#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
@@ -124,6 +126,31 @@ PHPAPI int core_globals_id;
#define SAFE_FILENAME(f) ((f)?(f):"-")
static char *get_safe_charset_hint(void) {
ZEND_TLS char *lastHint = NULL;
ZEND_TLS char *lastCodeset = NULL;
char *hint = SG(default_charset);
size_t len = strlen(hint);
size_t i = 0;
if (lastHint == SG(default_charset)) {
return lastCodeset;
}
lastHint = hint;
lastCodeset = NULL;
for (i = 0; i < sizeof(charset_map)/sizeof(charset_map[0]); i++) {
if (len == charset_map[i].codeset_len
&& zend_binary_strcasecmp(hint, len, charset_map[i].codeset, len) == 0) {
lastCodeset = (char*)charset_map[i].codeset;
break;
}
}
return lastCodeset;
}
/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnSetPrecision)
@@ -722,10 +749,10 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
buffer_len = (int)vspprintf(&buffer, 0, format, args);
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
/* Retry with substituting invalid chars on fail. */
if (!replace_buffer || ZSTR_LEN(replace_buffer) < 1) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, SG(default_charset));
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, get_safe_charset_hint());
}
efree(buffer);
@@ -792,7 +819,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
}
if (PG(html_errors)) {
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, SG(default_charset));
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, get_safe_charset_hint());
efree(origin);
origin = ZSTR_VAL(replace_origin);
}
@@ -1106,7 +1133,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
if (PG(html_errors)) {
if (type == E_ERROR || type == E_PARSE) {
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, ZSTR_VAL(buf), error_filename, error_lineno, STR_PRINT(append_string));
zend_string_free(buf);
} else {
@@ -1173,9 +1200,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
/* the parser would return 1 (failure), we can bail out nicely */
if (type == E_PARSE) {
CG(parse_error) = 0;
} else {
if (type != E_PARSE) {
/* restore memory limit */
zend_set_memory_limit(PG(memory_limit));
efree(buffer);
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_RELEASE_VERSION 24
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.0.24-dev"
#define PHP_VERSION_ID 70024
#define PHP_RELEASE_VERSION 25
#define PHP_EXTRA_VERSION "RC1"
#define PHP_VERSION "7.0.25RC1"
#define PHP_VERSION_ID 70025
+8 -4
View File
@@ -1535,15 +1535,19 @@ TEST $file
// Additional required extensions
if (array_key_exists('EXTENSIONS', $section_text)) {
$ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
$ext_params = array();
settings2array($ini_overwrites, $ext_params);
settings2params($ext_params);
$ext_dir=`$php $pass_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`;
$extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS']));
$loaded = explode(",", `$php -n -r 'echo join(",", get_loaded_extensions());'`);
$loaded = explode(",", `$php $pass_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`);
$ext_prefix = substr(PHP_OS, 0, 3) === "WIN" ? "php_" : "";
foreach ($extensions as $req_ext) {
if (!in_array($req_ext, $loaded)) {
if ($req_ext == 'opcache') {
$ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
$ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
} else {
$ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
$ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
}
}
}
+2 -2
View File
@@ -128,7 +128,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, zval *zv,
if (new_per_dir_entry->status >= orig_per_dir_entry->status) {
/* use new entry */
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", hash_key->arKey, new_per_dir_entry->status, orig_per_dir_entry->status));
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", ZSTR_VAL(hash_key->key), new_per_dir_entry->status, orig_per_dir_entry->status));
return 1;
} else {
return 0;
@@ -176,7 +176,7 @@ void apply_config(void *dummy)
php_dir_entry *data;
ZEND_HASH_FOREACH_STR_KEY_PTR(&d->config, str, data) {
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
phpapdebug((stderr, "APPLYING (%s)(%s)\n", ZSTR_VAL(str), data->value));
if (zend_alter_ini_entry_chars(str, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
+3 -3
View File
@@ -27,9 +27,9 @@ if test "$PHP_CGI" != "no"; then
AC_MSG_CHECKING([whether cross-process locking is required by accept()])
case "`uname -sr`" in
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
AC_MSG_RESULT([yes])
AC_DEFINE([USE_LOCKING], [1],
AC_DEFINE([USE_LOCKING], [1],
[Define if cross-process locking is required by accept()])
;;
*)
@@ -74,5 +74,5 @@ if test "$PHP_CGI" != "no"; then
PHP_OUTPUT(sapi/cgi/php-cgi.1)
else
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
fi
+87 -26
View File
@@ -171,6 +171,9 @@ typedef struct php_cli_server_client {
char *current_header_name;
size_t current_header_name_len;
unsigned int current_header_name_allocated:1;
char *current_header_value;
size_t current_header_value_len;
enum { HEADER_NONE=0, HEADER_FIELD, HEADER_VALUE } last_header_element;
size_t post_read_offset;
php_cli_server_request request;
unsigned int content_sender_initialized:1;
@@ -1469,7 +1472,7 @@ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath
#ifdef PHP_WIN32
{
char *p = decoded_vpath;
do {
if (*p == '\\') {
*p = '/';
@@ -1572,50 +1575,103 @@ static int php_cli_server_client_read_request_on_fragment(php_http_parser *parse
return 0;
}
static int php_cli_server_client_read_request_on_header_field(php_http_parser *parser, const char *at, size_t length)
static void php_cli_server_client_save_header(php_cli_server_client *client)
{
php_cli_server_client *client = parser->data;
/* strip off the colon */
zend_string *orig_header_name = zend_string_init(client->current_header_name, client->current_header_name_len, 1);
char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len);
zend_hash_str_add_ptr(&client->request.headers, lc_header_name, client->current_header_name_len, client->current_header_value);
zend_hash_add_ptr(&client->request.headers_original_case, orig_header_name, client->current_header_value);
efree(lc_header_name);
zend_string_release(orig_header_name);
if (client->current_header_name_allocated) {
pefree(client->current_header_name, 1);
client->current_header_name_allocated = 0;
}
client->current_header_name = (char *)at;
client->current_header_name_len = length;
client->current_header_name = NULL;
client->current_header_name_len = 0;
client->current_header_value = NULL;
client->current_header_value_len = 0;
}
static int php_cli_server_client_read_request_on_header_field(php_http_parser *parser, const char *at, size_t length)
{
php_cli_server_client *client = parser->data;
switch (client->last_header_element) {
case HEADER_VALUE:
php_cli_server_client_save_header(client);
/* break missing intentionally */
case HEADER_NONE:
client->current_header_name = (char *)at;
client->current_header_name_len = length;
break;
case HEADER_FIELD:
if (client->current_header_name_allocated) {
size_t new_length = client->current_header_name_len + length;
client->current_header_name = perealloc(client->current_header_name, new_length + 1, 1);
memcpy(client->current_header_name + client->current_header_name_len, at, length);
client->current_header_name[new_length] = '\0';
client->current_header_name_len = new_length;
} else {
size_t new_length = client->current_header_name_len + length;
char* field = pemalloc(new_length + 1, 1);
memcpy(field, client->current_header_name, client->current_header_name_len);
memcpy(field + client->current_header_name_len, at, length);
field[new_length] = '\0';
client->current_header_name = field;
client->current_header_name_len = new_length;
client->current_header_name_allocated = 1;
}
break;
}
client->last_header_element = HEADER_FIELD;
return 0;
}
static int php_cli_server_client_read_request_on_header_value(php_http_parser *parser, const char *at, size_t length)
{
php_cli_server_client *client = parser->data;
char *value = pestrndup(at, length, 1);
if (!value) {
return 1;
}
{
/* strip off the colon */
zend_string *orig_header_name = zend_string_init(client->current_header_name, client->current_header_name_len, 1);
char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len);
zend_hash_str_add_ptr(&client->request.headers, lc_header_name, client->current_header_name_len, value);
zend_hash_add_ptr(&client->request.headers_original_case, orig_header_name, value);
efree(lc_header_name);
zend_string_release(orig_header_name);
}
if (client->current_header_name_allocated) {
pefree(client->current_header_name, 1);
client->current_header_name_allocated = 0;
switch (client->last_header_element) {
case HEADER_FIELD:
client->current_header_value = pestrndup(at, length, 1);
client->current_header_value_len = length;
break;
case HEADER_VALUE:
{
size_t new_length = client->current_header_value_len + length;
client->current_header_value = perealloc(client->current_header_value, new_length + 1, 1);
memcpy(client->current_header_value + client->current_header_value_len, at, length);
client->current_header_value[new_length] = '\0';
client->current_header_value_len = new_length;
}
break;
case HEADER_NONE:
// can't happen
assert(0);
break;
}
client->last_header_element = HEADER_VALUE;
return 0;
}
static int php_cli_server_client_read_request_on_headers_complete(php_http_parser *parser)
{
php_cli_server_client *client = parser->data;
if (client->current_header_name_allocated) {
pefree(client->current_header_name, 1);
client->current_header_name_allocated = 0;
switch (client->last_header_element) {
case HEADER_NONE:
break;
case HEADER_FIELD:
client->current_header_value = pemalloc(1, 1);
*client->current_header_value = '\0';
client->current_header_value_len = 0;
/* break missing intentionally */
case HEADER_VALUE:
php_cli_server_client_save_header(client);
break;
}
client->current_header_name = NULL;
client->last_header_element = HEADER_NONE;
return 0;
}
@@ -1791,9 +1847,14 @@ static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_ser
}
php_http_parser_init(&client->parser, PHP_HTTP_REQUEST);
client->request_read = 0;
client->last_header_element = HEADER_NONE;
client->current_header_name = NULL;
client->current_header_name_len = 0;
client->current_header_name_allocated = 0;
client->current_header_value = NULL;
client->current_header_value_len = 0;
client->post_read_offset = 0;
if (FAILURE == php_cli_server_request_ctor(&client->request)) {
return FAILURE;
-2
View File
@@ -4,8 +4,6 @@ Bug #70470 (Built-in server truncates headers spanning over TCP packets)
<?php
include "skipif.inc";
?>
--XFAIL--
bug is not fixed yet
--FILE--
<?php
include "php_cli_server.inc";
+1 -13
View File
@@ -20,19 +20,7 @@ if (shell_exec('PowerShell -Help') === NULL)
// Hence on Windows 8, we don't verify that the title is actually set by
// cli_set_process_title(). We're only making the API calls to ensure there are
// no warnings/errors.
$is_windows8_or_above = false;
$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\"");
if ($ps_output === null)
{
echo "Get-Host failed\n";
die();
}
$ps_output = trim($ps_output);
$end_title_windows8 = ": Windows PowerShell";
if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8) || PHP_WINDOWS_VERSION_MAJOR >= 10)
$is_windows8_or_above = true;
$is_windows8_or_above = PHP_WINDOWS_VERSION_MAJOR >= 10 || PHP_WINDOWS_VERSION_MAJOR >= 6 && PHP_WINDOWS_VERSION_MINOR >= 2;
echo "*** Testing setting the process title ***\n";
+35
View File
@@ -0,0 +1,35 @@
--TEST--
Correctly handle split and empty header
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start("var_dump(getAllheaders());");
$fp = fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT, $errno, $errmsg, 0.5);
if (!$fp) {
die("connect failed: " . $errmsg);
}
fwrite($fp, "GET / HTTP/1.1\r\nUser-Agent\r\nAccept: */*\r\nReferer:\r\nHi\r\n\r\n");
fflush($fp);
while (!feof($fp)) {
echo fgets($fp);
}
fclose($fp);
?>
--EXPECTF--
HTTP/1.1 200 OK
%a
array(3) {
["User-AgentAccept"]=>
string(3) "*/*"
["Referer"]=>
string(0) ""
["Hi"]=>
string(0) ""
}
+1 -1
View File
@@ -4,7 +4,7 @@
$Id$
(c) 2011 Jerome Loyet
The PHP License, version 3.01
This is sample real-time status page for FPM. You can change it to better feet your needs.
This is sample real-time status page for FPM. You can change it to better fit your needs.
-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+2 -2
View File
@@ -5,5 +5,5 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
install-litespeed: $(SAPI_LITESPEED_PATH)
@echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75236: infinite loop when printing an error-message
--FILE--
<?php
ini_set('html_errors', true);
ini_set('default_charset', 'ISO-8859-2');
printf ("before getfilecontent\n");
file_get_contents ('no/suchfile');
printf ("after getfilecontent\n");
?>
--EXPECTF--
before getfilecontent
<br />
<b>Warning</b>: file_get_contents(no/suchfile): failed to open stream: No such file or directory in <b>%s</b> on line <b>7</b><br />
after getfilecontent
+15
View File
@@ -0,0 +1,15 @@
--TEST--
phpt EXTENSIONS directive with static module
--SKIPIF--
<?php
$php = getenv('TEST_PHP_EXECUTABLE');
if (false === stripos(`$php -n -m`, 'spl')) {
die('skip spl is NOT built static');
}
--EXTENSIONS--
SPL
--FILE--
<?php
var_dump(extension_loaded('spl'));
--EXPECT--
bool(true)
+8
View File
@@ -0,0 +1,8 @@
--TEST--
phpt EXTENSIONS directive with nonexistent shared module
--EXTENSIONS--
nonexistentsharedmodule
--FILE--
<?php
--EXPECTF--
PHP Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A
+17
View File
@@ -0,0 +1,17 @@
--TEST--
phpt EXTENSIONS directive with shared module
--SKIPIF--
<?php
$php = getenv('TEST_PHP_EXECUTABLE');
if (false !== stripos(`$php -n -m`, 'openssl')) {
die('skip openssl is built static');
}
$ext_module = ini_get('extension_dir') . DIRECTORY_SEPARATOR . (substr(PHP_OS, 0, 3) === "WIN" ? "php_openssl." : "openssl.") . PHP_SHLIB_SUFFIX;
if( !file_exists($ext_module) ) die('skip openssl shared extension not found');
--EXTENSIONS--
openssl
--FILE--
<?php
var_dump(extension_loaded('openssl'));
--EXPECT--
bool(true)
+10 -4
View File
@@ -80,8 +80,14 @@ sapi\phpdbg\phpdbg_lexer.c: sapi\phpdbg\phpdbg_lexer.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date -cbdFo sapi/phpdbg/phpdbg_lexer.c sapi/phpdbg/phpdbg_lexer.l
!endif
!if "$(ZTS)" == "1"
PHP7_PGD_SUFFIX=ts
!else
PHP7_PGD_SUFFIX=
!endif
!if $(PGOMGR) != ""
PHP7_PGD_OPTION=/PGD:$(PGOPGD_DIR)\php7.pgd
PHP7_PGD_OPTION=/PGD:$(PGOPGD_DIR)\php7$(PHP7_PGD_SUFFIX).pgd
!else
PHP7_PGD_OPTION=
!endif
@@ -236,9 +242,9 @@ really-install:
@if not exist $(PHP_PREFIX) mkdir $(PHP_PREFIX)
@if not exist $(PHP_PREFIX)\ext mkdir $(PHP_PREFIX)\ext
@echo Installing files under $(PHP_PREFIX)
@copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul
@copy $(BUILD_DIR)\php_*.dll $(PHP_PREFIX)\ext /y >nul
dir /b $(BUILD_DIR)\php_*.dll > $(BUILD_DIR)\extension_dlls.txt
@if exist $(BUILD_DIR)\*.exe copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul
@type nul > $(BUILD_DIR)\extension_dlls.txt
@if exist $(BUILD_DIR)\php_*.dll copy $(BUILD_DIR)\php_*.dll $(PHP_PREFIX)\ext /y >nul & dir /b $(BUILD_DIR)\php_*.dll > $(BUILD_DIR)\extension_dlls.txt
@xcopy $(BUILD_DIR)\*.dll /exclude:$(BUILD_DIR)\extension_dlls.txt $(PHP_PREFIX) /y >nul
@echo Registering event source with syslog (requires admin rights)
@echo It's okay for this step to fail:
+5
View File
@@ -2280,6 +2280,11 @@ function generate_makefile()
MF.WriteBlankLines(2);
MF.WriteLine("dump-tmp-env: set-tmp-env");
MF.WriteLine(" @set");
MF.WriteBlankLines(2);
MFO.Close();
TF = FSO.OpenTextFile("Makefile.objects", 1);
if (!TF.AtEndOfStream) {
+3 -3
View File
@@ -3,7 +3,7 @@ cclient-2007f
freetype-2.8.0
icu-57.1
jpeglib-9b
libcurl-7.54.1
libcurl-7.55.0
libiconv-1.15
libmcrypt-2.5.8
libmpir-3.0.0
@@ -11,6 +11,6 @@ libpng-1.6.29
libpq-9.6.2
libssh2-1.8.0
libtidy-20090406
libxslt-1.1.29
libxml-2.9.4
libxslt-1.1.30
libxml-2.9.5
openssl-1.0.2k
+21 -3
View File
@@ -36,7 +36,8 @@ function get_depends($module)
'odbc32.dll', 'ole32.dll', 'oleaut32.dll', 'rpcrt4.dll',
'shell32.dll', 'shlwapi.dll', 'user32.dll', 'ws2_32.dll', 'ws2help.dll',
'comctl32.dll', 'winmm.dll', 'wsock32.dll', 'winspool.drv', 'msasn1.dll',
'secur32.dll', 'netapi32.dll',
'secur32.dll', 'netapi32.dll', 'dnsapi.dll', 'psapi.dll', 'normaliz.dll',
'iphlpapi.dll',
/* apache */
'apachecore.dll',
@@ -64,8 +65,13 @@ function get_depends($module)
* (msvcrt7x.dll) are not */
'msvcrt.dll',
'msvcr90.dll',
'wldap32.dll'
'wldap32.dll',
'vcruntime140.dll',
'msvcp140.dll',
);
static $no_dist_re = array(
"api-ms-win-crt-.+\.dll",
);
global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps;
$bd = strtolower(realpath($build_dir));
@@ -93,6 +99,17 @@ function get_depends($module)
/* ignore some well-known system dlls */
if (in_array(basename($dep), $no_dist)) {
continue;
} else {
$skip = false;
foreach ($no_dist_re as $re) {
if (preg_match(",$re,", basename($dep)) > 0) {
$skip = true;
break;
}
}
if ($skip) {
continue;
}
}
if ($is_pecl) {
@@ -209,7 +226,8 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
/* the core dll */
copy("$build_dir/php.exe", "$dist_dir/php.exe");
copy("$build_dir/$phpdll", "$dist_dir/$phpdll");
/* copy dll and its dependencies */
copy_file_list($build_dir, "$dist_dir", [$phpdll]);
/* and the .lib goes into dev */
$phplib = str_replace(".dll", ".lib", $phpdll);
+7 -2
View File
@@ -1,6 +1,11 @@
@echo off
SET PHP_BUILDCONF_PATH=%~dp0
cscript /nologo %PHP_BUILDCONF_PATH%\script\phpize.js %*
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
IF NOT EXIST %PHP_BUILDCONF_PATH% (echo Error generating configure script, configure script was not copied) ELSE (echo Now run 'configure --help')
IF NOT EXIST configure.bat (
echo Error generating configure script, configure script was not copied
exit /b 3
) ELSE (
echo Now run 'configure --help'
)
SET PHP_BUILDCONF_PATH=