1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00
Commit Graph

11978 Commits

Author SHA1 Message Date
Nikita Popov
df27bfe58b Add debugging code to time_sleep_until test 2019-06-22 10:19:49 +02:00
Nikita Popov
1de7c4b919 Fix memory leaks in browscap parsing
Also make the interning a bit more efficient, no need to check for
a "real" interned string every time, we can also store that in the
HT.
2019-06-21 12:56:37 +02:00
Nikita Popov
59974000eb Remove leftover check
This is checked below now in a way that handles misaligned pointers.
2019-06-20 17:24:22 +02:00
Nikita Popov
26ac6cb6be Handle gethostbyname misalignment on macos 2019-06-20 16:22:40 +02:00
Nikita Popov
d4de127dd8 In php_needle_char() use well-defined double->integer cast
...by going through zval_get_long(). Generally out of range double
casts are undefined.
2019-06-20 16:22:10 +02:00
Nikita Popov
e8ae19223c Avoid address calculation overflow 2019-06-20 16:22:04 +02:00
Nikita Popov
4ae87f4bf9 Fix overflow UB in range() 2019-06-19 15:09:00 +02:00
Nikita Popov
8740533ddf Avoid more UB in round() 2019-06-19 15:09:00 +02:00
Nikita Popov
4b5e824aae Use unsigned char in _crypt_extended_r
Avoid signed shift UB.
2019-06-19 15:09:00 +02:00
Nikita Popov
bee7973e52 Use unsigned chars in php_uuencode()
Avoid shift UB on signed integers.
2019-06-19 15:09:00 +02:00
Nikita Popov
0c0659dc50 Fix _php_math_round UB
php_intlog10abs() is ill-defined for a zero value. Avoid calling it
altogether as there's nothing to round with a zero value.
2019-06-19 15:09:00 +02:00
Nikita Popov
317dfab81b Fix memcpy null arg UB 2019-06-19 15:09:00 +02:00
Joe Watkins
11f30d67ea Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix setcookie Max-Age to use php_time
2019-06-19 12:43:17 +02:00
Joe Watkins
a5db319463 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix setcookie Max-Age to use php_time
2019-06-19 12:42:25 +02:00
Joe Watkins
31a1c1e67c fix setcookie Max-Age to use php_time 2019-06-19 12:42:00 +02:00
Nikita Popov
d924b426c9 Fix file clash in fgetcsv test 2019-06-17 17:25:43 +02:00
Christoph M. Becker
e58e2fd0d4 Improve create_verify_dir() diagnostics
If create_verify_dir() fails[1], we need more info why that happened.

[1] <https://ci.appveyor.com/project/cmb69/php-src/builds/25324138/job/dm1n12gqhdqa3ln5#L5753>
2019-06-17 16:49:52 +02:00
Nikita Popov
4befe320e3 Use uint64_t for time_sleep_until calculations 2019-06-16 19:20:08 +02:00
Christoph M. Becker
11c3215251 Prevent parallel test conflict
Cf. <https://travis-ci.org/php/php-src/jobs/546112543#L2865-L2866>.
2019-06-16 11:48:48 +02:00
Joe Watkins
7e1972796b gettimeofday cannot be used to reliably implement high precision process synchronization
The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible
to use gettimeofday in this way reliably on any platform: It relies on operating system
global structures, which may be modified by any other process on the system at any time.

While in practice, users may be ignoring this flaw, it entirely depends on the other software
running on the system to which the application is deployed, there is no possible way to write
a test that will always pass on any system, therefore it must be marked XFAIL.
2019-06-16 07:02:28 +02:00
Joe Watkins
3852a35fdb This test is flaky, and some of it doesn't make sense.
I've refactored based on the original bug report, related bugs, and commits
to php-src that were related to them.

It is supposed to be testing windows specific behaviour related to non-blocking pipes,
nevertheless the test runs everywhere.
2019-06-15 09:57:51 +02:00
Nikita Popov
7410155dab Remove file/005_variation.phpt
As this test doesn't check differences in times before and after
operations, it doesn't actually verify anything and just wastes
30 seconds of test time.

As we already have other tests that do check how stat times change,
I'm removing it entirely.
2019-06-14 17:06:47 +02:00
Joe Watkins
f16b012116 fix mac tests on azure 2019-06-14 12:55:00 +02:00
Nikita Popov
19e2101dfa Revert "ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library"
This reverts commit bdcef51bcb.

It seems that pkg-config support for libargon2 is still flaky:
 * No pc file on Alpine.
 * Custom builds of released libargon2 versions create a broken
   pc file. This is fixed in master, but not released.

Go back to the old detection code for now.
2019-06-13 16:53:05 +02:00
Nikita Popov
6fcb469991 Fix unsigned char mismatch 2019-06-12 14:58:06 +02:00
Derick Rethans
ec57ba5edd Update CREDITS for PHP 7.4.0alpha1 2019-06-12 12:24:35 +01:00
Nikita Popov
fdfb390f07 Remove unused php_mbX_int_to_char() functions 2019-06-12 13:17:25 +02:00
Nikita Popov
5be772a19c Fix incorrect printf modifiers 2019-06-12 13:17:25 +02:00
Derick Rethans
06ddc025ac Update credits pre-release 2019-06-12 08:58:11 +01:00
Nikita Popov
b654a07492 Revert option rename
Let's keep this at --with-password-argon2 to avoid churn, I don't
think we have a strong motivation to rename this one.
2019-06-12 09:28:25 +02:00
Hugh McMaster
bdcef51bcb ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library 2019-06-12 06:54:54 +02:00
George Peter Banyard
7f5f277cf2 Remove unnecessary short_open_tag INI directive in tests
Closes GH-4249.
2019-06-11 16:14:10 +02:00
Christoph M. Becker
27e592d3ce Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77937: preg_match failed
2019-06-11 08:44:54 +02:00
Christoph M. Becker
b215d1339f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77937: preg_match failed
2019-06-11 08:44:07 +02:00
Christoph M. Becker
f3ff72e54b Fix #77937: preg_match failed
On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype functions, which are used internally by PCRE2 to
build the localized character tables.

Since there appears to be no way to properly check whether a given
locale is fully supported, but we want to minimize BC impact, we filter
out typical Unix locale names, except for a few cases which have
already been properly supported on Windows.  This way code like

  setlocale(LC_ALL, 'de_DE.UTF-8', 'de_DE', 'German_Germany.1252');

should work like on older Windows systems.

It should be noted that the locale names causing trouble are not (yet)
documented as valid names anyway, see
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=vs-2019>.
2019-06-11 08:42:32 +02:00
Dmitry Stogov
8fbfd8872a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:50:19 +03:00
Dmitry Stogov
972223c342 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:48:57 +03:00
Dmitry Stogov
83cdb89f8a Fixed bug #77135 (Extract with EXTR_SKIP should skip $this) 2019-06-07 11:36:39 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Joe Watkins
6f9a06cb74 this test is flaky on azure, and can't see why from current output
so refactored, and restored an accidentally removed check (resource)
2019-06-05 19:24:41 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Remi Collet
a0ce1df024 ignore first gets time which is usually a few ms only
in previous version, max_ms was "1" and "10" in travis/appveyor
having 10 by default make it fails on fast computer
2019-06-05 11:48:48 +02:00
Nikita Popov
84333cad67 Remove stream_socket_sendto.phpt
Fails for me locally due to different number of warnings with
different messages. Rather than adding more wildcards I'm dropping
this test entirely, as it doesn't seem to test anything particularly
useful.
2019-05-31 11:09:56 +02:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Dmitry Stogov
b2cb6a4a27 Avoid double copying 2019-05-28 13:35:00 +03:00
Dik Takken
77cf3d7b11 Allow array_merge() / array_merge_recursive() without arguments
This allows writing

    array_merge(...$arrays)

instead of

    array_merge([], ...$arrays)

and is in line with similar changes to array_push() and array_unshift()
in PHP 7.3.

Closes GH-4175.
2019-05-28 11:14:15 +02:00
Dmitry Stogov
072f28938f Put phpinfo() related code into cold code segment 2019-05-28 11:04:13 +03:00
Gabriel Caruso
4bb6f9ba99 Make more tests run on Windows 2019-05-27 10:51:53 +02:00
David Carlier
d9747c23a2 list net/interfaces, trying to get the error on windows when possible 2019-05-24 10:22:39 +02:00
Christoph M. Becker
c70975e0a5 Prevent further potential test conflicts
These tests partially use the same resource names; as a quick-fix we're
marking them all as conflicting.
2019-05-23 13:14:04 +02:00