1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 23:23:03 +02:00
Commit Graph

128697 Commits

Author SHA1 Message Date
Pierrick Charron
bbc0c4c5c8 Regen missing Zend/Optimizer/zend_func_infos.h 2022-06-13 09:49:41 -04:00
Pierrick Charron
6fd2b39397 Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Christoph M. Becker
e7f6acd068 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix handling of single-key connection strings
2022-06-13 14:44:49 +02:00
Christoph M. Becker
4b8bbfb6db Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix handling of single-key connection strings
2022-06-13 14:43:51 +02:00
Calvin Buckley
445d9502bf Fix handling of single-key connection strings
A connection string may contain just a single key, but
PHP used ";" as the heuristic to detect if a string was a connection
string versus plain DSN. However, a single-key connection string
would get treated like a DSN name, i.e. "DSN=*LOCAL". This makes it
so that "=" is used, as a connection string must contain a key.

Closes GH-8748.
2022-06-13 14:41:50 +02:00
Christoph M. Becker
02e0ae90d5 [ci skip] Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] Add missing NEWS entry
2022-06-13 14:39:37 +02:00
Christoph M. Becker
4a8c59d661 [ci skip] Add missing NEWS entry 2022-06-13 14:39:00 +02:00
Christoph M. Becker
145b98a1b1 [ci skip] Merge branch 'PHP-8.1'
* PHP-8.1:
  Restore backwards-compatible mappings of 0x5C and 0x7E in SJIS
2022-06-13 14:37:55 +02:00
twosee
b7a1633ecd Remove unused server_name variable
Closes GH-8760.
2022-06-13 13:14:08 +02:00
Tim Düsterhus
1a4401d40a Mark parameter in ext/zip as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
8f8243318d Mark parameter in ext/sodium as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
c311ab7ef7 Mark parameter in ext/openssl as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
e85b17b934 Mark parameter in ext/odbc as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
ac6dbbd183 Mark parameter in ext/oci8 as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
3a4d1b6131 Mark parameter in ext/mysqli as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
788b7a0c6c Mark parameter in ext/ldap as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
176a484df2 Mark parameter in ext/imap as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
f9fa6d0415 Mark parameter in ext/ftp as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
0d4147f0fb Mark parameter in ext/hash as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
6906d1fc8d Mark parameter in ext/pdo as sensitive 2022-06-13 11:09:12 +02:00
Tim Düsterhus
13758965b2 Mark parameter in ext/standard as sensitive
No changes to the stubs required, password_hash and password_verify were added
to the initial version of the stub support.
2022-06-13 11:09:12 +02:00
George Peter Banyard
0ae6a67550 Add true as a type (#8326)
RFC: https://wiki.php.net/rfc/true-type
2022-06-12 23:28:19 +01:00
Ilija Tovilo
ddc0b490f7 Allow arbitrary const expressions in backed enums
Closes GH-7821
Closes GH-8190
Closes GH-8418
2022-06-12 22:56:05 +02:00
Ilija Tovilo
5a855ee8d6 Fix GH-8661: Nullsafe in coalesce triggers undefined variable warning
Closes GH-8690
2022-06-12 21:52:14 +02:00
Alex Dowad
880803a21e Use fast conversion filters to implement php_mb_ord
Even for single-character strings, this is about 50% faster for
ASCII, UTF-8, and UTF-16. For long strings, the performance gain is
enormous, since the old code would convert the ENTIRE string, just
to pick out the first codepoint.
2022-06-12 15:24:41 +02:00
Alex Dowad
9468fa7ff2 mbfl_strlen does not need to use old conversion filters any more 2022-06-12 15:24:41 +02:00
Alex Dowad
950a7db9fe Use fast text conversion filters to implement mb_check_encoding
Benchmarking reveals that this is about 8% slower for UTF-8 strings
which have a bad codepoint at the very beginning of the string.
For good strings, or those where the first bad codepoint is much
later in the string, it is significantly faster (2-3 times faster
in many cases).
2022-06-12 15:24:41 +02:00
Alex Dowad
8533fccd63 Assert minimum size of wchar buffer in text conversion filters
In all text conversion filters which require the wchar buffer used for output
to have some minimum size, it's better to include an assertion; this will
help us to catch bugs, and will also help future readers to understand what
we expect of the function arguments.

For UTF-7 and UTF7-IMAP, these assertions were already there, but I have
added comments explaining why the minimum size is what it is.
2022-06-12 15:24:40 +02:00
Alex Dowad
871e61f942 Fully use available buffer space where converting Base64
I didn't think this through carefully enough when first writing this code,
but it's not necessary to reserve space for the 1-2 wchars which may be emitted
before exiting the function.

Why? Well, we are guaranteed that when we enter the function, there are at
least 3 spaces in the wchar buffer. The only way those can be consumed is if
wchars are emitted in the main 'while' loop, but if it does emit any wchars,
it will set 'bits' to zero at the same time, which means the final part will
not emit anything. 'bits' can be incremented again by the main loop, but the
main loop only runs while there are still at least 3 spaces in the buffer.

So basically, we are guaranteed that when the main loop terminates, either
there are 3 or more spaces remaining in the wchar buffer, or else 'bits' is
zero, or both.
2022-06-12 15:24:40 +02:00
Rowan Tommins
d9f3ca705c Add deprecation notices to utf8_encode and utf8_decode
Implements initial stage of accepted RFC to remove them:
https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode

Tests relating to SOAP and htmlspecialchars seem to have been
using this entirely unnecessarily, so have been fixed.

Closes GH-8726.
2022-06-12 13:37:23 +02:00
Ilija Tovilo
e79046fbe4 Fix redundant ZSTR_VAL condition in php_date.c (#8753)
ZSTR_VAL can never be NULL as zend_string.val is a char[1] which will
always decay to a non-nullable pointer.

This fails with -Werror on newer gcc versions.
2022-06-12 10:59:37 +02:00
Ilija Tovilo
3f7ec69b61 Collapse more generated files in PRs (#8754)
* The generated VM files
* tokenizer_data.c
2022-06-12 10:56:35 +02:00
Alex Dowad
13479ee2bd Restore backwards-compatible mappings for 0x5C/0x7E in SJIS (for fast conversion filter)
In d62f535caa, the legacy mbstring conversion filters for Shift-JIS
was updated to restore backwards-compatible mappings for 0x5C/0x7E.
Make the same change to the newer fast conversion filters.
2022-06-11 17:09:16 +02:00
Christoph M. Becker
85a95a2982 Merge branch 'PHP-8.1'
* PHP-8.1:
  Restore backwards-compatible mappings of 0x5C and 0x7E in SJIS
2022-06-11 16:32:33 +02:00
Alex Dowad
d62f535caa Restore backwards-compatible mappings of 0x5C and 0x7E in SJIS
According to the relevant Japan Industrial Standards Committee standards,
SJIS 0x5C is a Yen sign, and 0x7E is an overline.

However, this conflicts with the implementation of SJIS in various legacy
software (notably Microsoft products), where SJIS 0x5C and 0x7E are taken
as equivalent to the same ASCII bytes.

Prior to PHP 8.1, mbstring's implementation of SJIS handled these bytes
compatibly with Microsoft products. This was changed in PHP 8.1.0, in an
attempt to comply with the JISC specifications. However, after discussion
with various concerned Japanese developers, it seems that the historical
behavior was more useful in the majority of applications which process
SJIS-encoded text.

Since we are now treating SJIS 0x5C as equivalent to U+005C and 0x7E as
equivalent to U+007E, it does not make sense to convert U+203E (OVERLINE)
to 0x7E, nor does it make sense to convert U+00A5 (YEN SIGN) to 0x5C. Restore
the mappings for those codepoints from before PHP 8.1.0.

Fixes GH-8281.
2022-06-11 16:31:47 +02:00
David CARLIER
6b02cabc8a Add SO_SETFIB FreeBSD socket option constant.
Aims to set the route table.
Closes #8742.
2022-06-11 13:03:21 +01:00
Alex Dowad
2dc9026cbc Restore backwards-compatible mappings of 0x5C and 0x7E in SJIS
According to the relevant Japan Industrial Standards Committee standards,
SJIS 0x5C is a Yen sign, and 0x7E is an overline.

However, this conflicts with the implementation of SJIS in various legacy
software (notably Microsoft products), where SJIS 0x5C and 0x7E are taken
as equivalent to the same ASCII bytes.

Prior to PHP 8.1, mbstring's implementation of SJIS handled these bytes
compatibly with Microsoft products. This was changed in PHP 8.1.0, in an
attempt to comply with the JISC specifications. However, after discussion
with various concerned Japanese developers, it seems that the historical
behavior was more useful in the majority of applications which process
SJIS-encoded text.

Since we are now treating SJIS 0x5C as equivalent to U+005C and 0x7E as
equivalent to U+007E, it does not make sense to convert U+203E (OVERLINE)
to 0x7E, nor does it make sense to convert U+00A5 (YEN SIGN) to 0x5C. Restore
the mappings for those codepoints from before PHP 8.1.0.
2022-06-10 21:04:36 +02:00
Pierrick Charron
bad26b7560 Merge branch 'PHP-8.1' 2022-06-10 12:45:30 -04:00
Pierrick Charron
77ba689fd6 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-10 12:44:39 -04:00
Pierrick Charron
df4dd82ea0 Fix bad integer promotion in mysqlnd big5 charset detection 2022-06-10 12:41:54 -04:00
Christoph M. Becker
d7bdc040b4 Join shm_pair.info and .segment of Windows shm implementation
There is not much point in having two distinct file mappings; since the
info mapping is very small and of fixed size, we can put it at the
beginning of a single mapping.  Besides the obvious resource savings,
that also simplifies the error handling.

Closes GH-8648.
2022-06-10 17:18:27 +02:00
Remi Collet
e9e3a1481b Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] missing CVE
2022-06-10 14:35:21 +02:00
Remi Collet
8b07921a0c [ci skip] missing CVE 2022-06-10 14:35:12 +02:00
Remi Collet
976f5fda87 Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] missing CVE
  [ci skip] missing CVE
2022-06-10 14:32:30 +02:00
Remi Collet
9261679560 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] missing CVE
  [ci skip] missing CVE
2022-06-10 14:32:06 +02:00
Remi Collet
62f64141ef [ci skip] missing CVE 2022-06-10 14:31:48 +02:00
Remi Collet
ba2d095fe6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] missing CVE
2022-06-10 14:28:57 +02:00
Remi Collet
198f3f509d [ci skip] missing CVE 2022-06-10 14:28:31 +02:00
Derick Rethans
242b9438ea Fixed tests that relied on date.timezone=UTC to work 2022-06-10 12:00:25 +01:00
Christoph M. Becker
e86acb1861 Run POD_Firebird tests on AppVeyor CI
We also fix gh8626.phpt for the firebird driver by allowing negative
status codes as well.  We mark the other two test cases as xfail for
the firebird driver for now.

Closes GH-8666.
2022-06-10 12:22:44 +02:00