From a9fad08a2ad708585e0e479a202458ea4394e2cc Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:11:03 +0800 Subject: [PATCH 1/3] [skip ci] Update LICENSE to 2026 (GH-21562) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index b155a18c2fb73..16af9a6ae1e7f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -------------------------------------------------------------------- The PHP License, version 3.01 -Copyright (c) 1999 - 2025 The PHP Group. All rights reserved. +Copyright (c) 1999 - 2026 The PHP Group. All rights reserved. -------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without From 3c800ccf729aab8327494a65b4fdea68dda68983 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:24:02 +0800 Subject: [PATCH 2/3] [skip ci] Fix various typos in ext/standard (GH-21559) --- ext/standard/base64.c | 4 ++-- ext/standard/metaphone.c | 4 ++-- ext/standard/var.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 8d4feee84975b..02b8fa421be82 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -536,7 +536,7 @@ zend_string *php_base64_encode_avx512_vbmi(const unsigned char *str, size_t leng /* Step 2: splitting 24-bit words into 32-bit lanes */ str = _mm512_permutexvar_epi8(shuffle_splitting, str); - /* Step 3: moving 6-bit word to sperate bytes */ + /* Step 3: moving 6-bit word to separate bytes */ str = _mm512_multishift_epi64_epi8(multi_shifts, str); /* Step 4: conversion to ASCII */ @@ -643,7 +643,7 @@ zend_string *php_base64_encode_avx512(const unsigned char *str, size_t length, z /* [D1 D2 D0 D1|C1 C2 C0 C1|B1 B2 B0 B1|A1 A2 A0 A1] x 4 */ str = _mm512_shuffle_epi8(str, _mm512_set4_epi32(0x0a0b090a, 0x07080607, 0x04050304, 0x01020001)); - /* Step 3: moving 6-bit word to sperate bytes */ + /* Step 3: moving 6-bit word to separate bytes */ /* in: [bbbbcccc|ccdddddd|aaaaaabb|bbbbcccc] */ /* t0: [0000cccc|cc000000|aaaaaa00|00000000] */ const __m512i t0 = _mm512_and_si512(str, _mm512_set1_epi32(0x0fc0fc00)); diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 149f95c127c6b..6b80f2e3a8e08 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -107,7 +107,7 @@ static zend_always_inline char encode(char c) { /*----------------------------- */ /* I suppose I could have been using a character pointer instead of - * accesssing the array directly... */ + * accessing the array directly... */ #define Convert_Raw(c) toupper(c) /* Look at the next letter in the word */ @@ -264,7 +264,7 @@ static void metaphone(unsigned char *word, size_t word_len, zend_long max_phonem for (; (curr_letter = Read_Raw_Curr_Letter) != '\0' && (max_phonemes == 0 || Phone_Len < (size_t)max_phonemes); w_idx++) { - /* How many letters to skip because an eariler encoding handled + /* How many letters to skip because an earlier encoding handled * multiple letters */ unsigned short int skip_letter = 0; diff --git a/ext/standard/var.c b/ext/standard/var.c index e0184d9af718a..fc8b2f4f37848 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1242,7 +1242,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_ && Z_OBJ_HT_P(struc)->get_properties_for == NULL && Z_OBJ_HT_P(struc)->get_properties == zend_std_get_properties && !zend_object_is_lazy(Z_OBJ_P(struc))) { - /* Optimized version without rebulding properties HashTable */ + /* Optimized version without rebuilding properties HashTable */ zend_object *obj = Z_OBJ_P(struc); zend_class_entry *ce = obj->ce; zend_property_info *prop_info; From 7647b47ae99490da2329bdbe55b4ab45e0cab22b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 28 Mar 2026 04:03:02 +0000 Subject: [PATCH 3/3] Fix GH-21557: jewishtojd returns 0 for years >= 6000. The year >= 6000 upper bound introduced in GH-18849 was too restrictive as it is a valid year in the Jewish calendar. The overflow protection in MoladOfMetonicCycle already handles large values, the only guard needed is to prevent year + 1 from wrapping around INT_MAX. close GH-21558 --- NEWS | 4 ++++ ext/calendar/jewish.c | 2 +- ext/calendar/tests/gh21557.phpt | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ext/calendar/tests/gh21557.phpt diff --git a/NEWS b/NEWS index f20e8d63b0259..4e743a954fd80 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.3.31 +- Calendar: + . Fixed bug GH-21557 (jewishtojd returns 0 for years >= 6000). + (David Carlier) + 15 Jan 2026, PHP 8.3.30 diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c index 2fbdcb059b096..f527199745285 100644 --- a/ext/calendar/jewish.c +++ b/ext/calendar/jewish.c @@ -714,7 +714,7 @@ zend_long JewishToSdn( int yearLength; int lengthOfAdarIAndII; - if (year <= 0 || year >= 6000 || day <= 0 || day > 30) { + if (year <= 0 || year >= INT_MAX - 1 || day <= 0 || day > 30) { return (0); } switch (month) { diff --git a/ext/calendar/tests/gh21557.phpt b/ext/calendar/tests/gh21557.phpt new file mode 100644 index 0000000000000..1aa5e65cb3426 --- /dev/null +++ b/ext/calendar/tests/gh21557.phpt @@ -0,0 +1,24 @@ +--TEST-- +GH-21557 jewishtojd returns 0 for years >= 6000 +--CREDITS-- +oleibman +--EXTENSIONS-- +calendar +--FILE-- + +--EXPECT-- +yh=5995 rh=2537279 +yh=5996 rh=2537633 +yh=5997 rh=2538016 +yh=5998 rh=2538371 +yh=5999 rh=2538725 +yh=6000 rh=2539110 +yh=6001 rh=2539463 +yh=6002 rh=2539818 +yh=6003 rh=2540202 +yh=6004 rh=2540557