Skip to content

Commit 5fe1dc1

Browse files
committed
Merge remote-tracking branch 'php/master'
2 parents 1f40a4c + 1922f41 commit 5fe1dc1

File tree

131 files changed

+95
-7519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+95
-7519
lines changed

.github/actions/configure-macos/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ runs:
1818
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxslt/lib/pkgconfig"
1919
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/zlib/lib/pkgconfig"
2020
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/icu4c/lib/pkgconfig"
21+
sed -i -e 's/Requires.private:.*//g' "$BREW_OPT/curl/lib/pkgconfig/libcurl.pc"
2122
./buildconf --force
2223
./configure \
2324
--enable-option-checking=fatal \

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ PHP NEWS
1616
. Added Dom\Element::$outerHTML. (nielsdos)
1717
. Added Dom\Element::insertAdjacentHTML(). (nielsdos)
1818

19+
- Intl:
20+
. Bumped ICU requirement to ICU >= 57.1. (cmb)
21+
1922
- Output:
2023
. Fixed calculation of aligned buffer size. (cmb)
2124

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ PHP 8.5 UPGRADE NOTES
2929
. It is no longer possible to use "array" and "callable" as class alias names
3030
in class_alias().
3131

32+
- Intl:
33+
. The extension now requires at least ICU 57.1.
34+
3235
- LDAP:
3336
. ldap_get_option() and ldap_set_option() now throw a ValueError when
3437
passing an invalid option.

build/php.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ dnl
17791779
dnl Common setup macro for ICU.
17801780
dnl
17811781
AC_DEFUN([PHP_SETUP_ICU],[
1782-
PKG_CHECK_MODULES([ICU], [icu-uc >= 50.1 icu-io icu-i18n])
1782+
PKG_CHECK_MODULES([ICU], [icu-uc >= 57.1 icu-io icu-i18n])
17831783
17841784
PHP_EVAL_INCLINE([$ICU_CFLAGS])
17851785
PHP_EVAL_LIBLINE([$ICU_LIBS], [$1])

ext/curl/config.w32

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,13 @@
33
ARG_WITH("curl", "cURL support", "no");
44

55
if (PHP_CURL != "no") {
6-
var ver_num = NaN;
7-
var f = PHP_PHP_BUILD + "/include/curl/curlver.h";
8-
if (FSO.FileExists(f)) {
9-
var reg = /LIBCURL_VERSION_NUM\s+(0x[a-z0-9]+)/gi;
10-
var m = reg.exec(file_get_contents(PHP_PHP_BUILD + "/include/curl/curlver.h"));
11-
if (!!m && m.length >= 2) {
12-
ver_num = parseInt(m[1]);
13-
}
14-
}
15-
166
if (CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL) &&
177
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
188
SETUP_OPENSSL("curl", PHP_CURL) >= 2 &&
199
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
2010
CHECK_LIB("wldap32.lib", "curl", PHP_CURL) &&
2111
(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "curl", PHP_CURL))) ||
2212
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "curl", PHP_CURL)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
23-
!isNaN(ver_num) &&
2413
(CHECK_LIB("normaliz.lib", "curl", PHP_CURL) &&
2514
CHECK_LIB("libssh2.lib", "curl", PHP_CURL) &&
2615
CHECK_LIB("nghttp2.lib", "curl", PHP_CURL))

ext/dom/dom_iterators.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
177177
if (objmap->nodetype != XML_ENTITY_NODE &&
178178
objmap->nodetype != XML_NOTATION_NODE) {
179179
if (objmap->nodetype == DOM_NODESET) {
180-
HashTable *nodeht = HASH_OF(&objmap->baseobj_zv);
180+
HashTable *nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
181181
zval *entry;
182182
zend_hash_move_forward_ex(nodeht, &iterator->pos);
183183
if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
@@ -275,7 +275,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
275275
if (objmap->nodetype != XML_ENTITY_NODE &&
276276
objmap->nodetype != XML_NOTATION_NODE) {
277277
if (objmap->nodetype == DOM_NODESET) {
278-
nodeht = HASH_OF(&objmap->baseobj_zv);
278+
nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
279279
zend_hash_internal_pointer_reset_ex(nodeht, &iterator->pos);
280280
if ((entry = zend_hash_get_current_data_ex(nodeht, &iterator->pos))) {
281281
ZVAL_COPY(&iterator->curobj, entry);

ext/dom/nodelist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ zend_long php_dom_get_nodelist_length(dom_object *obj)
7272
}
7373

7474
if (objmap->nodetype == DOM_NODESET) {
75-
HashTable *nodeht = HASH_OF(&objmap->baseobj_zv);
75+
HashTable *nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
7676
return zend_hash_num_elements(nodeht);
7777
}
7878

@@ -145,7 +145,7 @@ void php_dom_nodelist_get_item_into_zval(dom_nnodemap_object *objmap, zend_long
145145
itemnode = php_dom_libxml_hash_iter(objmap, index);
146146
} else {
147147
if (objmap->nodetype == DOM_NODESET) {
148-
HashTable *nodeht = HASH_OF(&objmap->baseobj_zv);
148+
HashTable *nodeht = Z_ARRVAL_P(&objmap->baseobj_zv);
149149
zval *entry = zend_hash_index_find(nodeht, index);
150150
if (entry) {
151151
ZVAL_COPY(return_value, entry);

ext/gd/gd.c

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,24 +1358,6 @@ PHP_FUNCTION(imagetypes)
13581358
}
13591359
/* }}} */
13601360

1361-
/* {{{ _php_ctx_getmbi */
1362-
1363-
static int _php_ctx_getmbi(gdIOCtx *ctx)
1364-
{
1365-
int i, mbi = 0;
1366-
1367-
do {
1368-
i = (ctx->getC)(ctx);
1369-
if (i < 0) {
1370-
return -1;
1371-
}
1372-
mbi = (mbi << 7) | (i & 0x7f);
1373-
} while (i & 0x80);
1374-
1375-
return mbi;
1376-
}
1377-
/* }}} */
1378-
13791361
/* {{{ _php_image_type
13801362
* Based on ext/standard/image.c
13811363
*/
@@ -1413,15 +1395,8 @@ static int _php_image_type(zend_string *data)
14131395
}
14141396
}
14151397

1416-
gdIOCtx *io_ctx;
1417-
io_ctx = gdNewDynamicCtxEx(8, ZSTR_VAL(data), 0);
1418-
if (io_ctx) {
1419-
if (_php_ctx_getmbi(io_ctx) == 0 && _php_ctx_getmbi(io_ctx) >= 0) {
1420-
io_ctx->gd_free(io_ctx);
1421-
return PHP_GDIMG_TYPE_WBM;
1422-
} else {
1423-
io_ctx->gd_free(io_ctx);
1424-
}
1398+
if (ZSTR_VAL(data)[0] == 0) {
1399+
return PHP_GDIMG_TYPE_WBM;
14251400
}
14261401

14271402
return -1;

ext/gd/tests/gh16771.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
GH-16771 (UBSan abort in ext/gd/libgd/gd.c:1372)
3+
--EXTENSIONS--
4+
gd
5+
--FILE--
6+
<?php
7+
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OIMzTvvJXvvJbml6XmnKzoqp7jg4bjgq3jgrnjg4g=');
8+
imagecreatefromstring($string_mb);
9+
--EXPECTF--
10+
Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
4.89 KB
Binary file not shown.

0 commit comments

Comments
 (0)