]> granicus.if.org Git - php/log
php
5 years agoReindent phpt files
Nikita Popov [Mon, 3 Feb 2020 21:52:20 +0000 (22:52 +0100)]
Reindent phpt files

5 years agoEnable formatting of phpt files in tidy.php
Nikita Popov [Mon, 3 Feb 2020 12:46:42 +0000 (13:46 +0100)]
Enable formatting of phpt files in tidy.php

5 years agoFix indentation/trailing whitespaces of 32-bit tests
Máté Kocsis [Mon, 3 Feb 2020 15:50:59 +0000 (16:50 +0100)]
Fix indentation/trailing whitespaces of 32-bit tests

5 years agoFix indentation/trailing whitespaces of tests
Máté Kocsis [Mon, 3 Feb 2020 14:00:44 +0000 (15:00 +0100)]
Fix indentation/trailing whitespaces of tests

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 3 Feb 2020 12:41:45 +0000 (13:41 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Apply tidy formatting

5 years agoApply tidy formatting
Nikita Popov [Mon, 3 Feb 2020 12:41:31 +0000 (13:41 +0100)]
Apply tidy formatting

Mostly reindent PHP scripts to spaces.

5 years agoAdd bundled jit libraries to exclude list
Nikita Popov [Mon, 3 Feb 2020 12:41:09 +0000 (13:41 +0100)]
Add bundled jit libraries to exclude list

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 3 Feb 2020 12:35:49 +0000 (13:35 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add tidy.php to enforce formatting

5 years agoAdd tidy.php to enforce formatting
Nikita Popov [Fri, 10 Jan 2020 14:52:42 +0000 (15:52 +0100)]
Add tidy.php to enforce formatting

Many parts are disabled for the PHP-7.4 branch. We only strip
trailing whitespace in C files and reindent .php files to spaces.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 3 Feb 2020 12:05:54 +0000 (13:05 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Relax test expectation

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 3 Feb 2020 12:05:09 +0000 (13:05 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Relax test expectation

5 years agoRelax test expectation
Christoph M. Becker [Mon, 3 Feb 2020 12:02:12 +0000 (13:02 +0100)]
Relax test expectation

Since we're dealing with floating point numbers, precision issues may
hit us, and actually it's not necessary to check for the exact number
anyway, because it is not exact in the first place.  Therefore, we
relax the test expectations.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 3 Feb 2020 11:30:42 +0000 (12:30 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79212: NumberFormatter::format() may detect wrong type

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 3 Feb 2020 11:29:28 +0000 (12:29 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79212: NumberFormatter::format() may detect wrong type

5 years agoFix #79212: NumberFormatter::format() may detect wrong type
Christoph M. Becker [Sun, 2 Feb 2020 12:38:34 +0000 (13:38 +0100)]
Fix #79212: NumberFormatter::format() may detect wrong type

We have to convert to number *before* detecting the type, to cater to
internal objects implementing `cast_object`.

We also get rid of the fallback behavior of using `FORMAT_TYPE_INT32`,
because that can no longer happen; after `convert_scalar_to_number_ex`
the type is either `IS_LONG` or `IS_DOUBLE`.  We cater explicitly to
the `IS_ARRAY` case what also avoids triggering a type confusion when
`::TYPE_INT64` is passed as `$type`.

5 years agozip ext is now 1.17.1
Remi Collet [Mon, 3 Feb 2020 10:37:20 +0000 (11:37 +0100)]
zip ext is now 1.17.1

5 years agoExport zend_type_to_string() with ZEND_API
Derick Rethans [Mon, 3 Feb 2020 10:26:20 +0000 (10:26 +0000)]
Export zend_type_to_string() with ZEND_API

5 years agoMerge branch 'PHP-7.4'
Remi Collet [Mon, 3 Feb 2020 09:24:57 +0000 (10:24 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  add test
  NEWS
  Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method

5 years agoadd test
Remi Collet [Mon, 3 Feb 2020 09:21:46 +0000 (10:21 +0100)]
add test

5 years agoNEWS
Remi Collet [Mon, 3 Feb 2020 09:09:12 +0000 (10:09 +0100)]
NEWS

5 years agoFixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method
Remi Collet [Mon, 3 Feb 2020 09:06:44 +0000 (10:06 +0100)]
Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method

5 years agoMerge branch 'PHP-7.4'
Remi Collet [Mon, 3 Feb 2020 09:09:27 +0000 (10:09 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  NEWS
  Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method

5 years agoNEWS
Remi Collet [Mon, 3 Feb 2020 09:09:12 +0000 (10:09 +0100)]
NEWS

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 3 Feb 2020 09:08:20 +0000 (10:08 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add WHITESPACE_SENSITIVE run-tests section

5 years agoAdd WHITESPACE_SENSITIVE run-tests section
Nikita Popov [Fri, 10 Jan 2020 15:54:12 +0000 (16:54 +0100)]
Add WHITESPACE_SENSITIVE run-tests section

This is used to indicate that the test should not be changed by
automated formatting changes.

5 years agoFixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method
Remi Collet [Mon, 3 Feb 2020 09:06:44 +0000 (10:06 +0100)]
Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 3 Feb 2020 08:58:03 +0000 (09:58 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Disable parallelism for FPM tests

5 years agoDisable parallelism for FPM tests
Nikita Popov [Mon, 3 Feb 2020 08:57:34 +0000 (09:57 +0100)]
Disable parallelism for FPM tests

Let's see if this helps with spurious failures on Azure.

5 years agoFix another batch of indentation in tests
Máté Kocsis [Sun, 2 Feb 2020 22:18:45 +0000 (23:18 +0100)]
Fix another batch of indentation in tests

5 years agoClean up the generation of the parsers
Akim Demaille [Sat, 1 Feb 2020 06:07:28 +0000 (07:07 +0100)]
Clean up the generation of the parsers

Prefer '%define api.value.type' to '#define YYSTYPE', so that Bison
know the type.

Use '%code requires' to declare what is needed to define the api.value.type
(that code is output in the generated header before the generated
definition of YYSTYPE).

Prefer '%define api.prefix' inside the grammar file to '-p' outside,
as anyway the functions defined in the file actually use this prefix.

Prefer `%param` to both `%parse-param` and `%lex-param`.

Closes GH-5138

5 years agoBison: enable all the warnings and fix them
Akim Demaille [Sat, 1 Feb 2020 06:03:13 +0000 (07:03 +0100)]
Bison: enable all the warnings and fix them

First, fix 5547d361208d90e12d53bb62bb2ffbbff9b93ca0: the definition of
YFLAGS was not passed into the Makefile: AC_SUBST does not suffice, we
need PHP_SUBST_OLD.  While at it, allow to pass variable and value at
the same time.

Then pass -Wall to bison, rather than only -Wempty-rules.

Use %precedence where associativity is useless.

Remove useless %precedence.
GH-5138

5 years agoAdded opcache extension to inis
Pieter Hordijk [Fri, 31 Jan 2020 14:46:43 +0000 (17:46 +0300)]
Added opcache extension to inis

Extensions are not loaded by default (commented out)

Closes GH-5136

5 years agoFix var_dump test
Máté Kocsis [Fri, 31 Jan 2020 17:36:43 +0000 (18:36 +0100)]
Fix var_dump test

5 years agoFix indentation and whitespaces in tests
Máté Kocsis [Fri, 31 Jan 2020 16:20:00 +0000 (17:20 +0100)]
Fix indentation and whitespaces in tests

In preparation for GH-5074

5 years agoinline by hand to avoid uninitialized variable warning
Sebastian Pop [Wed, 29 Jan 2020 14:54:19 +0000 (14:54 +0000)]
inline by hand to avoid uninitialized variable warning

When compiling with "-Wall -Werror" gcc emits two errors:

../src/pcre2_jit_neon_inc.h:211:8: error: ‘cmp1b’ is used uninitialized in this function [-Werror=uninitialized]
  211 | data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/pcre2_jit_neon_inc.h:212:9: error: ‘cmp2b’ is used uninitialized in this function [-Werror=uninitialized]
  212 | data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The compiler emits the error message before inlining.
Because the warning is based on an intra-procedural data
flow analysis, the compiler does not see that cmp1b and
cmp2b are not used when they are not initialized.

Here is the code of that function, cmp2 is only used
when ctype is compare_match2 or compare_match1i,
and not when ctype is compare_match1:

static inline vect_t fast_forward_char_pair_compare(compare_type ctype, vect_t dst, vect_t cmp1, vect_t cmp2)
{
if (ctype == compare_match2)
 {
 vect_t tmp = dst;
 dst = VCEQQ(dst, cmp1);
 tmp = VCEQQ(tmp, cmp2);
 dst = VORRQ(dst, tmp);
 return dst;
 }

if (ctype == compare_match1i)
  dst = VORRQ(dst, cmp2);
dst = VCEQQ(dst, cmp1);
return dst;
}

The patch inlines by hand the case of compare_match1 such that the
code avoids referring to cmp1b and cmp2b.

Tested on aarch64-linux with `make check`.

5 years agoWe don't need "safe" destruction anymore
Dmitry Stogov [Fri, 31 Jan 2020 13:01:09 +0000 (16:01 +0300)]
We don't need "safe" destruction anymore

5 years agoThese EG(current_execute_data) = EX(prev_execute_data) assignments are useless now
Dmitry Stogov [Fri, 31 Jan 2020 11:50:41 +0000 (14:50 +0300)]
These EG(current_execute_data) = EX(prev_execute_data) assignments are useless now

5 years agoExport zend_dump_op() and add ZEND_DUMP_NUMERIC_OPLINES flag to print oplines as...
Dmitry Stogov [Fri, 31 Jan 2020 10:27:35 +0000 (13:27 +0300)]
Export zend_dump_op() and add ZEND_DUMP_NUMERIC_OPLINES flag to print oplines as "dddd" instead of "Ld+"

5 years agoFix JIT as well
Nikita Popov [Fri, 31 Jan 2020 09:35:46 +0000 (10:35 +0100)]
Fix JIT as well

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 31 Jan 2020 09:30:09 +0000 (10:30 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #76047

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 31 Jan 2020 09:29:26 +0000 (10:29 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #76047

5 years agoFix bug #76047
Nikita Popov [Fri, 31 Jan 2020 09:21:37 +0000 (10:21 +0100)]
Fix bug #76047

Unlink the current stack frame before freeing CVs or extra args.
This means it will no longer show up in back traces that are
generated during CV destruction.

We already did this prior to destructing the object/closure,
presumably for the same reason.

5 years agoUse "%empty" in the parsers, instead of comments
Akim Demaille [Thu, 30 Jan 2020 17:09:25 +0000 (18:09 +0100)]
Use "%empty" in the parsers, instead of comments

The annotation %empty is properly enforced: warnings when it's
missing, and errors when it's inappropriate.  Support for %empty was
introduced in Bison 3.0.

Pass -Wempty-rule to Bison.

Closes GH-5134

5 years agoZip: version is now 1.17.0
Remi Collet [Fri, 31 Jan 2020 08:10:10 +0000 (09:10 +0100)]
Zip: version is now 1.17.0
change for Windows (which have libzip 1.4 by default)
update NEWS

5 years agoadd ZipArchive::registerProgressCallback and ZipArchive::registerCancelCallback methods
Remi Collet [Thu, 30 Jan 2020 10:14:53 +0000 (11:14 +0100)]
add ZipArchive::registerProgressCallback and ZipArchive::registerCancelCallback methods

5 years agoFixed JIT part for bug #79094
Dmitry Stogov [Fri, 31 Jan 2020 07:39:22 +0000 (10:39 +0300)]
Fixed JIT part for bug #79094

5 years agoMerge branch 'PHP-7.4'
Dmitry Stogov [Fri, 31 Jan 2020 07:34:28 +0000 (10:34 +0300)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79094 (Crashing when running recursion function)

5 years agoFixed bug #79094 (Crashing when running recursion function)
Dmitry Stogov [Fri, 31 Jan 2020 07:34:04 +0000 (10:34 +0300)]
Fixed bug #79094 (Crashing when running recursion function)

5 years agoAdd NEWS entry for new ReflectionProperty methods.
Benjamin Eberlei [Thu, 30 Jan 2020 16:48:20 +0000 (17:48 +0100)]
Add NEWS entry for new ReflectionProperty methods.

5 years agoPromote mysqli warnings to exceptions
Máté Kocsis [Sun, 5 Jan 2020 18:49:34 +0000 (19:49 +0100)]
Promote mysqli warnings to exceptions

Closes GH-5058

5 years agoRevert "Make BG(syslog_device) per request"
Nikita Popov [Thu, 30 Jan 2020 15:18:02 +0000 (16:18 +0100)]
Revert "Make BG(syslog_device) per request"

This reverts commit b0d7b126a29a1972229ac91d6d28f5331912eddb.

This change wasn't quite right: I noticed only now that the
RSHUTDOWN function is #ifdef PHP_WIN32 and I'm not fully convinced
that ifdef can be removed: syslog might also be used by error
logging in FPM for example, in which case we probably shouldn't
be closing the log here.

Generally it's unclear how the openlog() functionality exposed
by PHP is supposed to interact with openlog() uses by SAPIs.

For now I'll just revert this change and let it leak across
requests.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 14:52:22 +0000 (15:52 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  fix cross compilation failure due to size_t typecast in define

5 years agofix cross compilation failure due to size_t typecast in define
Pascal de Bruijn [Thu, 30 Jan 2020 12:48:44 +0000 (13:48 +0100)]
fix cross compilation failure due to size_t typecast in define

The following commit introduces a cross-compilation failure:

   93c728b77cfb47f5cfdd1863f8982ea59d344205
  "Try to control ZEND_MM_ALIGNED_SIZE type"

br-arm-full/build/php-7.4.2/Zend/zend_alloc.h:30:38:
error: missing binary operator before token "8"
                                              ^
br-arm-full/build/php-7.4.2/ext/opcache/ZendAccelerator.c:1380:7:
note: in expansion of macro ‘ZEND_MM_ALIGNMENT’

Closes GH-5128.

5 years agoInitialize SplFixedArray elements to NULL instead of UNDEF
Nikita Popov [Thu, 30 Jan 2020 14:31:39 +0000 (15:31 +0100)]
Initialize SplFixedArray elements to NULL instead of UNDEF

The SplFixedArray API treats all elements as NULL, even if they
have not been explicitly initialized. Rather than initializing
to UNDEF an treating that specially in various circumstances,
directly initialize elements to NULL.

This also fixes an assertion failure in the attached test case.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 13:56:31 +0000 (14:56 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79193

5 years agoFixed bug #79193
Nikita Popov [Thu, 30 Jan 2020 13:55:58 +0000 (14:55 +0100)]
Fixed bug #79193

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 13:24:28 +0000 (14:24 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix live range calculation for FE_FETCH

5 years agoFix live range calculation for FE_FETCH
Nikita Popov [Thu, 30 Jan 2020 13:23:46 +0000 (14:23 +0100)]
Fix live range calculation for FE_FETCH

Op2 is def here, not a use, so treat it accordingly.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 12:14:29 +0000 (13:14 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix DatePeriod property handling with indirect modification

5 years agoFix DatePeriod property handling with indirect modification
Nikita Popov [Thu, 30 Jan 2020 12:09:15 +0000 (13:09 +0100)]
Fix DatePeriod property handling with indirect modification

We do need to implement get_property_ptr_ptr to make arrays work
correctly.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Thu, 30 Jan 2020 12:07:34 +0000 (13:07 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #70078: XSL callbacks with nodes as parameter leak memory

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 30 Jan 2020 12:05:49 +0000 (13:05 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #70078: XSL callbacks with nodes as parameter leak memory

5 years agoFix #70078: XSL callbacks with nodes as parameter leak memory
Christoph M. Becker [Wed, 29 Jan 2020 17:23:51 +0000 (18:23 +0100)]
Fix #70078: XSL callbacks with nodes as parameter leak memory

The fix for bug #49634 solved a double-free by copying the node with
`xmlDocCopyNodeList()`, but the copied node is later freed by calling
`xmlFreeNode()` instead of `xmlFreeNodeList()`, thus leaking memory.
However, there is no need to treat the node as node list, i.e. to copy
also the node's siblings; just creating a recursive copy of the node
with `xmlDocCopyNode()` is sufficient, while that also avoids the leak.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 11:17:15 +0000 (12:17 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix leak in DateTimeImmutable::modify()

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 30 Jan 2020 11:17:10 +0000 (12:17 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix leak in DateTimeImmutable::modify()

5 years agoFix leak in DateTimeImmutable::modify()
Nikita Popov [Thu, 30 Jan 2020 11:16:43 +0000 (12:16 +0100)]
Fix leak in DateTimeImmutable::modify()

5 years agoUpdate test for warning -> fatal error change
Nikita Popov [Thu, 30 Jan 2020 11:12:09 +0000 (12:12 +0100)]
Update test for warning -> fatal error change

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 10:56:36 +0000 (11:56 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix copying of functions in variance obligations

5 years agoFix copying of functions in variance obligations
Nikita Popov [Thu, 30 Jan 2020 10:55:38 +0000 (11:55 +0100)]
Fix copying of functions in variance obligations

Only copy sizeof(zend_internal_function) for internal functions.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 10:21:32 +0000 (11:21 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add SKIPIF to test requiring mbregex

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 30 Jan 2020 10:21:26 +0000 (11:21 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add SKIPIF to test requiring mbregex

5 years agoAdd SKIPIF to test requiring mbregex
Nikita Popov [Thu, 30 Jan 2020 10:20:42 +0000 (11:20 +0100)]
Add SKIPIF to test requiring mbregex

5 years agoFix leak in DatePeriod construction with invalid format
Nikita Popov [Thu, 30 Jan 2020 10:13:04 +0000 (11:13 +0100)]
Fix leak in DatePeriod construction with invalid format

Same issue as I fixed in DateInterval construction before.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 10:05:56 +0000 (11:05 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Reset trampoline on executor startup
  Fix UAF in is_callable() and allocated trampoline

5 years agoReset trampoline on executor startup
Nikita Popov [Thu, 30 Jan 2020 10:03:14 +0000 (11:03 +0100)]
Reset trampoline on executor startup

Make sure the trampoline is usable, even if we had an unclean
shutdown on the last request.

5 years agoFix UAF in is_callable() and allocated trampoline
Nikita Popov [Thu, 30 Jan 2020 10:01:13 +0000 (11:01 +0100)]
Fix UAF in is_callable() and allocated trampoline

By nulling out the function_handler, so it will not get used
below. Reuse the existing helper for this purpose.

5 years agoFix #74063: NumberFormatter fails after retrieval from session
Christoph M. Becker [Wed, 29 Jan 2020 15:18:46 +0000 (16:18 +0100)]
Fix #74063: NumberFormatter fails after retrieval from session

While it would be desireable to actually support unserialization of
NumberFormatter instances, at least we should not allow serialization
for now.

We also remove some doubtful tests, which have been added[1] claiming
that they would crash the intl extension, but apparently no fix has
been applied, and the test cases have not been marked as XFAIL.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=ed793b2a3f857fd49c0c1b036062140da5b3e674>

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 30 Jan 2020 09:08:21 +0000 (10:08 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix shift ub in mbstring
  Restore digit check in mb_decode_numericentity()

5 years agoFix shift ub in mbstring
Nikita Popov [Tue, 28 Jan 2020 15:18:46 +0000 (16:18 +0100)]
Fix shift ub in mbstring

Ideally "c" would be an unsigned integer...

5 years agoRestore digit check in mb_decode_numericentity()
Nikita Popov [Wed, 29 Jan 2020 15:40:13 +0000 (16:40 +0100)]
Restore digit check in mb_decode_numericentity()

I replaced it with a multiplication overflow check in
18599f9c52959b2e8cbfac57e278644499a3547d. However, we need both,
because the code for restoring the number can't handle numbers
with many leading zeros right now and I don't feel like teaching it.

5 years agoEnable ZipArchive::setMtime(Name|Index) on Windows
Christoph M. Becker [Wed, 29 Jan 2020 17:19:54 +0000 (18:19 +0100)]
Enable ZipArchive::setMtime(Name|Index) on Windows

These are enabled on non Windows systems as of zip 1.16.0 with libzip
>= 1.0.0.  Since Windows builds use at least libzip 1.4.0, we also
enable these methods there.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 29 Jan 2020 15:19:21 +0000 (16:19 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix mb_ord() crash if internal encoding not supported

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 29 Jan 2020 15:19:14 +0000 (16:19 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix mb_ord() crash if internal encoding not supported

5 years agoFix mb_ord() crash if internal encoding not supported
Nikita Popov [Wed, 29 Jan 2020 15:17:30 +0000 (16:17 +0100)]
Fix mb_ord() crash if internal encoding not supported

enc_name can be NULL here. Take the name from the mbfl_encoding
instead.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 29 Jan 2020 15:08:55 +0000 (16:08 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Better overflow check for entity decoding

5 years agoBetter overflow check for entity decoding
Nikita Popov [Wed, 29 Jan 2020 13:22:45 +0000 (14:22 +0100)]
Better overflow check for entity decoding

Check for multiplication overflow rather than number of digits.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 29 Jan 2020 15:05:47 +0000 (16:05 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Reset MBREX(search_re) in RSHUTDOWN

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 29 Jan 2020 15:05:38 +0000 (16:05 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Reset MBREX(search_re) in RSHUTDOWN

5 years agoReset MBREX(search_re) in RSHUTDOWN
Nikita Popov [Wed, 29 Jan 2020 15:03:44 +0000 (16:03 +0100)]
Reset MBREX(search_re) in RSHUTDOWN

This is going to cause a segfault if reused in the next request.
To illustrate the issue, run these two scripts in sequence with
the built-in server:

// script1.php
mb_ereg_search_init('foobar');
mb_ereg_search('foo');

// script2.php
var_dump(mb_ereg_search_init("foobar"));
var_dump(mb_ereg_search_pos());

5 years agozip extension version is now 1.16.1
Remi Collet [Wed, 29 Jan 2020 13:26:03 +0000 (14:26 +0100)]
zip extension version is now 1.16.1

5 years agoMerge branch 'PHP-7.4'
Remi Collet [Wed, 29 Jan 2020 13:25:26 +0000 (14:25 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  zip: more constants

5 years agozip: more constants
Remi Collet [Wed, 29 Jan 2020 13:25:16 +0000 (14:25 +0100)]
zip: more constants

5 years agoMerge branch 'PHP-7.4'
Anatol Belski [Wed, 29 Jan 2020 12:40:09 +0000 (13:40 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Backport 7d2ef3d2e540885dec26d91dad061bff1621ad07 into 7.4

5 years agoBackport 7d2ef3d2e540885dec26d91dad061bff1621ad07 into 7.4
Anatol Belski [Wed, 29 Jan 2020 12:19:27 +0000 (13:19 +0100)]
Backport 7d2ef3d2e540885dec26d91dad061bff1621ad07 into 7.4

As the data structures are public, the fix for 64-bit consists
on replacing the blanket memcpy with individual assignments.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 29 Jan 2020 11:50:47 +0000 (12:50 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix use of mb_ereg_search_getregs() after invalid pattern

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 29 Jan 2020 11:50:40 +0000 (12:50 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix use of mb_ereg_search_getregs() after invalid pattern

5 years agoFix use of mb_ereg_search_getregs() after invalid pattern
Nikita Popov [Wed, 29 Jan 2020 11:49:28 +0000 (12:49 +0100)]
Fix use of mb_ereg_search_getregs() after invalid pattern

This segfaulted because we assumed that if there are matches,
there must be a regular expression as well.

5 years agoFix datatype
Anatol Belski [Wed, 29 Jan 2020 11:34:04 +0000 (12:34 +0100)]
Fix datatype

This has been introduced by 84b0d0fabaaf21ee056984a33b573121296af942.
Besides it causes runtime issues on POWER5 (and presumably later), the
implementation would expect this array to consist on 32-bit integers.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 29 Jan 2020 11:22:58 +0000 (12:22 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix length inconsistency in mb_convert_encoding

5 years agoFix length inconsistency in mb_convert_encoding
Nikita Popov [Wed, 29 Jan 2020 11:19:28 +0000 (12:19 +0100)]
Fix length inconsistency in mb_convert_encoding

Don't mix strlen() and ZSTR_LEN(). If the encoding contains a
NULL byte, this will overflow the buffer.

NULL bytes will still make this behave oddly because the consuming
code will cut off the string there, but let's address that in master...