Skip to content

sync #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 87 commits into from
Dec 14, 2022
Merged

sync #20

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bcc0030
Updated to version 2022.7 (2022g)
derickr Nov 29, 2022
6f71697
Empty merge
derickr Nov 29, 2022
e568f93
Updated to version 2022.7 (2022g)
derickr Nov 29, 2022
ac1b232
Empty merge
derickr Nov 29, 2022
ebde5d3
Updated to version 2022.7 (2022g)
derickr Nov 29, 2022
44377c3
Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
cmb69 Nov 29, 2022
e29ca36
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Nov 30, 2022
7402d90
Merge branch 'PHP-8.2'
cmb69 Nov 30, 2022
818b46a
Import timelib 2021.18
derickr Nov 30, 2022
d021851
Fixed GH-9699, GH-9866, and GH-9880 (problems with diff); and GH-9700…
derickr Nov 30, 2022
64f5f53
Merge remote-tracking branch 'derickr/timelib-2021.18' into PHP-8.1
derickr Nov 30, 2022
83b714d
Merge branch 'PHP-8.1' into PHP-8.2
derickr Nov 30, 2022
f9ef2db
Merge branch 'PHP-8.2'
derickr Nov 30, 2022
41fef8b
Import timelib 2022.03
derickr Nov 30, 2022
d6ac533
Merge branch 'PHP-8.2'
derickr Nov 30, 2022
c87c803
Some (old, backwards compatible) TZIDs can have numbers in them
derickr Dec 1, 2022
29f0f4e
Merge branch 'regression-tzid-with-numbers' into PHP-8.1
derickr Dec 1, 2022
1316a5b
Merge branch 'PHP-8.1' into PHP-8.2
derickr Dec 1, 2022
853e9ca
Merge branch 'PHP-8.2'
derickr Dec 1, 2022
d4c804b
[ci skip] Add missing entries to php.ini quick reference
cmb69 Dec 1, 2022
683d81e
Fix incorrect short-circuiting in constant expressions (#10030)
iluuu1994 Dec 1, 2022
93592ea
Fix GH-9769: Misleading error message for unpacking of objects
jhdxr Nov 17, 2022
6b1f4c5
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 2, 2022
9f0e4a5
Merge branch 'PHP-8.2'
cmb69 Dec 2, 2022
c4a0fc6
Fix zend_fcc_equals() with trampolines (#10012)
Girgias Dec 2, 2022
608ddb0
Fix GH-10011 (Trampoline autoloader will get reregistered and cannot …
Girgias Dec 2, 2022
334d108
Merge branch 'PHP-8.1' into PHP-8.2
Girgias Dec 2, 2022
d952419
Merge branch 'PHP-8.2'
Girgias Dec 2, 2022
adc2382
Fallback to first line of function when ex->opline is NULL (#10003)
arnaud-lb Dec 2, 2022
b683a7e
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 5, 2022
6109b80
Merge branch 'PHP-8.2'
cmb69 Dec 5, 2022
b6b4a62
ext/mysqli tests "using password" optional in error messages
grooverdan Dec 2, 2022
0ac9e8e
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 5, 2022
4ae1f08
Merge branch 'PHP-8.2'
cmb69 Dec 5, 2022
e4ef394
Drop superfluous check for imap_stream
cmb69 Dec 5, 2022
2f6b9e6
Fix #81742: open_basedir bypass in SQLite3 by using file URI
cmb69 Dec 5, 2022
8301803
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 6, 2022
568ed47
Merge branch 'PHP-8.2'
cmb69 Dec 6, 2022
696bb38
PHP-8.1 is now for PHP 8.1.15-dev
ramsey Dec 7, 2022
35a4950
Replace Azure DevOps link with GitHub Actions
ramsey Dec 7, 2022
11b612a
Rename PHP_STREAM_TO_ZVAL to PHP_STREAM_FROM_ZVAL (#10065)
nielsdos Dec 7, 2022
3f3c1df
[ci skip] Fix GH-10056: [grammar] "less security-conscience applicati…
cmb69 Dec 8, 2022
01eabdc
[ci skip] Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 8, 2022
b628989
[ci skip] Merge branch 'PHP-8.2'
cmb69 Dec 8, 2022
c21a592
ext/mysqli tests "using password" optional in error messages (part 2)
grooverdan Dec 7, 2022
a76bbd3
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 8, 2022
005a765
Merge branch 'PHP-8.2'
cmb69 Dec 8, 2022
faef55d
standard/basic_functions.c remove x bit on this file (#10069)
devnexen Dec 9, 2022
a1a69c3
Support Microsoft's "Best Fit" mappings for Windows-1252 text encoding
alexdowad Dec 6, 2022
b79a86f
Merge branch 'PHP-8.1' into PHP-8.2
alexdowad Dec 9, 2022
14110bf
Merge branch 'PHP-8.2'
alexdowad Dec 9, 2022
b77edf8
Fix mysqli test wrt. MariaDB
grooverdan Dec 1, 2022
1b503a1
Merge branch 'PHP-8.2'
cmb69 Dec 9, 2022
ac3ecd0
Add `Randomizer::getBytesFromString()` method (#9664)
joshuaruesweg Dec 9, 2022
16ce751
[ci skip] Add json_validate() RFC link to UPGRADING
TimWolla Dec 9, 2022
b34cdc5
[ci skip] Fix json_validate() formatting in NEWS
TimWolla Dec 9, 2022
6422cf6
intl extension: msgfmt_set_pattern add pattern format error informati…
devnexen Nov 27, 2022
e114f32
Avoid code duplication in php_ini.c (#4512)
glensc Dec 10, 2022
8a221e2
fix litespeed SAPI build warnings.
devnexen Dec 10, 2022
91e70a4
Merge branch 'PHP-8.2'
devnexen Dec 10, 2022
a839230
Fix compilation on RHEL 7 ppc64le (gcc 4.8)
ellert Nov 30, 2021
b96b88b
Merge branch 'PHP-8.2'
iluuu1994 Dec 11, 2022
0c0774f
Use fast text conversion filters for mb_strpos, mb_stripos, mb_substr…
alexdowad Oct 4, 2022
b3d197d
Optimize SJIS decoder for speed
alexdowad Dec 2, 2022
4072a76
Move MacJapanese implementation into mbfilter_sjis.c
alexdowad Dec 3, 2022
005e49e
Optimize MacJapanese decoder for speed
alexdowad Dec 3, 2022
4ebfddf
Move mobile variants of SJIS into mbfilter_sjis.c
alexdowad Dec 3, 2022
43cdfa3
Optimize SJIS-Mobile#DOCOMO decoder for speed
alexdowad Dec 3, 2022
6bf0c44
Optimize SJIS-Mobile#KDDI decoder for speed
alexdowad Dec 3, 2022
e36c600
Optimize SJIS-Mobile#SOFTBANK decoder for speed
alexdowad Dec 4, 2022
3be2b0d
Add CLEAN section to some IO tests (#10081)
Girgias Dec 12, 2022
fa3bbf0
Fix borked Windows tests after 3be2b0d0d83702db409bfcc3fbb4a176d565932d
Girgias Dec 12, 2022
3fb7198
intl extension, follow up on #10006 for numfmt_set_pattern
devnexen Dec 9, 2022
c5ab727
[skip ci] Change status of BCMath into Maintained (#10089)
frederikbosch Dec 13, 2022
3ab18d4
Change if (stack) check to an assertion (#10090)
nielsdos Dec 13, 2022
aef7d81
Fix GH-9949: Partial content on incomplete POST request
cmb69 Dec 6, 2022
87c2f5b
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 13, 2022
2ca03be
Merge branch 'PHP-8.2'
cmb69 Dec 13, 2022
7a983e2
Fix Windows shmget() wrt. IPC_PRIVATE
TysonAndre Nov 15, 2022
9089e15
Merge branch 'PHP-8.1' into PHP-8.2
cmb69 Dec 13, 2022
b593b53
Merge branch 'PHP-8.2'
cmb69 Dec 13, 2022
4631e9d
shmget() with IPC_CREAT must not create 0 size SHM
cmb69 Dec 13, 2022
f8ff105
Merge branch 'PHP-8.2'
cmb69 Dec 13, 2022
52a891a
Add a new imap_is_open() function to check that a connection object i…
Girgias Dec 13, 2022
4a36513
Merge branch 'PHP-8.2'
Girgias Dec 13, 2022
002d54d
PHP-8.2 is now for PHP 8.2.2-dev
adoy Dec 14, 2022
2f119c3
Merge branch 'PHP-8.2'
adoy Dec 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: bcmath
PRIMARY MAINTAINER: Andi Gutmans <andi@php.net> (2000 - 2004)
MAINTENANCE: Unknown
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: bz2
Expand Down
10 changes: 8 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ PHP NEWS
. Fixed bug #81738: buffer overflow in hash_update() on long parameter.
(CVE-2022-37454) (nicky at mouha dot be)

- Intl:
. Added pattern format error infos for msgfmt_set_pattern. (David Carlier)
. Added pattern format error infos for numfmt_set_pattern. (David Carlier)

- JSON:
. Implemented RFC: json_validate()
https://wiki.php.net/rfc/json_validate (Juan Morales)
. Added json_validate(). (Juan Morales)

- Opcache:
. Added start, restart and force restart time to opcache's
Expand All @@ -55,6 +58,9 @@ PHP NEWS
- Posix:
. Added posix_sysconf. (David Carlier)

- Random:
. Added Randomizer::getBytesFromString(). (Joshua Rüsweg)

- Reflection:
. Fix GH-9470 (ReflectionMethod constructor should not find private parent
method). (ilutov)
Expand Down
35 changes: 34 additions & 1 deletion TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "tsrm_win32.h"
#include "zend_virtual_cwd.h"
#include "win32/ioutil.h"
#include "win32/winutil.h"

#ifdef ZTS
static ts_rsrc_id win32_globals_id;
Expand Down Expand Up @@ -610,6 +611,22 @@ TSRM_API int pclose(FILE *stream)
#define SEGMENT_PREFIX "TSRM_SHM_SEGMENT:"
#define INT_MIN_AS_STRING "-2147483648"


#define TSRM_BASE_SHM_KEY_ADDRESS 0x20000000
/* Returns a number between 0x2000_0000 and 0x3fff_ffff. On Windows, key_t is int. */
static key_t tsrm_choose_random_shm_key(key_t prev_key) {
unsigned char buf[4];
if (php_win32_get_random_bytes(buf, 4) != SUCCESS) {
return prev_key + 2;
}
uint32_t n =
((uint32_t)(buf[0]) << 24) |
(((uint32_t)buf[1]) << 16) |
(((uint32_t)buf[2]) << 8) |
(((uint32_t)buf[3]));
return (n & 0x1fffffff) + TSRM_BASE_SHM_KEY_ADDRESS;
}

TSRM_API int shmget(key_t key, size_t size, int flags)
{/*{{{*/
shm_pair *shm;
Expand All @@ -621,11 +638,14 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
snprintf(shm_segment, sizeof(shm_segment), SEGMENT_PREFIX "%d", key);

shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
} else {
/* IPC_PRIVATE always creates a new segment even if IPC_CREAT flag isn't passed. */
flags |= IPC_CREAT;
}

if (!shm_handle) {
if (flags & IPC_CREAT) {
if (size > SIZE_MAX - sizeof(shm->descriptor)) {
if (size == 0 || size > SIZE_MAX - sizeof(shm->descriptor)) {
return -1;
}
size += sizeof(shm->descriptor);
Expand All @@ -649,6 +669,19 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
}
}

if (key == IPC_PRIVATE) {
/* This should call shm_get with a brand new key id that isn't used yet. See https://man7.org/linux/man-pages/man2/shmget.2.html
* Because extensions such as shmop/sysvshm can be used in userland to attach to shared memory segments, use unpredictable high positive numbers to avoid accidentally conflicting with userland. */
key = tsrm_choose_random_shm_key(TSRM_BASE_SHM_KEY_ADDRESS);
for (shm_pair *ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
if (ptr->descriptor && ptr->descriptor->shm_perm.key == key) {
key = tsrm_choose_random_shm_key(key);
ptr = TWG(shm);
continue;
}
}
}

shm = shm_get(key, NULL);
if (!shm) {
CloseHandle(shm_handle);
Expand Down
5 changes: 5 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ PHP 8.3 UPGRADE NOTES
- JSON:
. Added json_validate(), which returns whether the json is valid for
the given $depth and $options.
RFC: https://wiki.php.net/rfc/json_validate

- Posix:
. Added posix_sysconf call to get runtime informations.

- Random:
. Added Randomizer::getBytesFromString().
RFC: https://wiki.php.net/rfc/randomizer_additions

- Sockets:
. Added socket_atmark to checks if the socket is OOB marked.

Expand Down
15 changes: 15 additions & 0 deletions Zend/tests/array_unpack/gh9769.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Unpacking arrays in constant expression
--FILE--
<?php

const A = [...[1, 2, 3]];
const B = [...['a'=>1, 'b'=>2, 'c'=>3]];
const C = [...new ArrayObject()];

?>
--EXPECTF--
Fatal error: Uncaught Error: Only arrays can be unpacked in constant expression in %sgh9769.php:5
Stack trace:
#0 {main}
thrown in %sgh9769.php on line 5
14 changes: 14 additions & 0 deletions Zend/tests/gh10014.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
GH-10014: Incorrect short-circuiting in constant expressions
--FILE--
<?php

#[Attribute(+[[][2]?->y]->y)]
class y {
}

?>
--EXPECTF--
Warning: Undefined array key 2 in %s on line %d

Warning: Attempt to read property "y" on array in %s on line %d
8 changes: 8 additions & 0 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,14 @@ ZEND_API zend_result zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_
/* Zend FCC API to store and handle PHP userland functions */
static zend_always_inline bool zend_fcc_equals(const zend_fcall_info_cache* a, const zend_fcall_info_cache* b)
{
if (UNEXPECTED((a->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) &&
(b->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))) {
return a->object == b->object
&& a->calling_scope == b->calling_scope
&& a->closure == b->closure
&& zend_string_equals(a->function_handler->common.function_name, b->function_handler->common.function_name)
;
}
return a->function_handler == b->function_handler
&& a->object == b->object
&& a->calling_scope == b->calling_scope
Expand Down
Loading