From 8b6ab1903d8941a486ed5140382cb6677fca093a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Thu, 10 Sep 2026 08:34:16 +0200 Subject: [PATCH 1/3] Fix improper handling of empty string in `Char::ord` method **Details:** - Updated `Char::ord` to explicitly check for empty string using `=== ''` instead of falsy check (`?:`). - Ensures correct behavior when an empty string is passed, resolving potential misinterpretation of input. - Maintains consistent handling of invalid input scenarios in accordance with expected behavior. --- src/Char/MB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Char/MB.php b/src/Char/MB.php index 9606bf0..d6d1701 100644 --- a/src/Char/MB.php +++ b/src/Char/MB.php @@ -86,7 +86,7 @@ public static function chr (int $codepoint, ?Encoding $encoding = null):string|f public static function ord (string $character, ?Encoding $encoding = null):int|false { /** @var non-negative-int|false */ - return mb_ord($character ?: "\0", $encoding?->value); + return mb_ord($character === '' ? "\0" : $character, $encoding?->value); } From ae51672b6f28ba28896c8c467580bed6c8d859b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Thu, 10 Sep 2026 08:35:10 +0200 Subject: [PATCH 2/3] Update `CHANGELOG.md` for version `v0.2.5` **Details:** - Added a new section for version `v0.2.5` with release date and hyperlink to GitHub comparison. - Documented the fix for improper handling of empty string in `Char::ord` method. - Ensures consistent changelog formatting and accurate version tracking. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4607a7e..d2c6cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [[v0.2.5](https://github.com/The-FireHub-Project/Runtime/compare/v0.2.4...v0.2.5)] – 2026-09-11 + +### Fixed +* Fix improper handling of empty string in `Char::ord` method by @dieselxxx + ## [[v0.2.4](https://github.com/The-FireHub-Project/Runtime/compare/v0.2.3...v0.2.4)] – 2026-09-03 ### Changed From 0753ccc85dc8609757a2a842382deaad71d806bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danijel=20Gali=C4=87?= Date: Thu, 10 Sep 2026 08:35:57 +0200 Subject: [PATCH 3/3] Update badge version in `README.md` to `v0.2.5` **Details:** - Updated the version badge in `Runtime/README.md` from `v0.2.4` to `v0.2.5`. - Ensures the displayed version in documentation matches the latest release for consistency and transparency. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c92d88f..2a24190 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ /> version