Skip to content

Commit c4a130f

Browse files
committed
CHANGELOG: roll everything since 2.6.3 into one unreleased 3.0.0 section
- 2.6.3 is the last version that actually shipped (bundled with CMSB v3.83); 2.7.0 was tagged but never bundled, so its jsonEncode hardening and $text rename fold into 3.0.0 with the rest - Reads as one set of changes since 2.6.3 instead of release-by-release history
1 parent 20d6c4d commit c4a130f

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# SmartString Changelog
22

3-
## [2.8.0] - [UNRELEASED]
3+
## [3.0.0] - [UNRELEASED]
4+
5+
### Security
6+
- `jsonEncode()` now substitutes malformed UTF-8 bytes with � (U+FFFD) instead of throwing JsonException, so one corrupt byte in a value no longer breaks the whole page
7+
- `jsonEncode()` now re-escapes invisible Unicode (zero-width chars, bidi controls, Unicode tag chars, variation selectors) as visible \uXXXX escapes so nothing can hide in page source. Lossless: each escape decodes back to the identical character, so the value JavaScript sees never changes
8+
- `json_encode($smartString)` now also substitutes malformed UTF-8 with � instead of returning false, matching `jsonEncode()`
49

510
### Changed
611
- `nl2br()` is back as the primary name for "HTML-encode, then convert newlines to `<br>`".
@@ -27,12 +32,10 @@
2732
a PHP warning and continuing with a null value
2833
- `help()` is now static, so `SmartString::help()` (the documented form) and `$str->help()`
2934
both work (previously the static call was a fatal error)
35+
- `or404()`, `orDie()`, `orThrow()` message parameter renamed to `$text` and documented as
36+
HTML-encoded before output
3037
- `orDie()` exits with code 1 so CLI and cron callers see a failure exit code
3138

32-
### Deprecated
33-
- `percent()` `$zeroFallback` parameter - use `->percent($decimals)->ifZero($fallback)`
34-
instead (logs a deprecation notice when passed; no live callers found in a 31-site scan)
35-
3639
### Removed
3740
- `SmartString` constructor and `new()` no longer accept a `$properties` array - it only
3841
carried the internal numeric-error flag, and nothing outside the class used it
@@ -52,16 +55,6 @@
5255
2. **Pre-2.6 `->nl2br()` chains** - `->nl2br()->value()` and similar now fail with "call to a
5356
member function on string". Move chained methods before `->nl2br()`; it is a terminal call.
5457

55-
## [2.7.0] - 2026-07-07
56-
57-
### Security
58-
- `jsonEncode()` now substitutes malformed UTF-8 bytes with � (U+FFFD) instead of throwing JsonException, so one corrupt byte in a value no longer breaks the whole page
59-
- `jsonEncode()` now re-escapes invisible Unicode (zero-width chars, bidi controls, Unicode tag chars, variation selectors) as visible \uXXXX escapes so nothing can hide in page source. Lossless: each escape decodes back to the identical character, so the value JavaScript sees never changes
60-
- `json_encode($smartString)` now also substitutes malformed UTF-8 with � instead of returning false, matching `jsonEncode()`
61-
62-
### Changed
63-
- `or404()`, `orDie()`, `orThrow()` message parameter renamed to `$text` and documented as HTML-encoded before output
64-
6558
## [2.6.3] - 2026-04-27
6659
> **Bundled with CMS Builder v3.83**
6760
> Roll-up release - every change from **v2.2.1 → v2.6.3** is now part of this version.

‎tests/Unit/EncodingTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function testUrlEncodeDocblockExample(): void
163163
//region jsonEncode()
164164

165165
/**
166-
* The 2.7.0 hardening contract, ported as-is: malformed UTF-8 becomes �
166+
* The jsonEncode hardening contract, ported as-is: malformed UTF-8 becomes �
167167
* instead of throwing, and invisible Unicode is re-escaped as visible
168168
* \uXXXX (losslessly).
169169
*/

0 commit comments

Comments
 (0)