|
1 | 1 | # SmartString Changelog |
2 | 2 |
|
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()` |
4 | 9 |
|
5 | 10 | ### Changed |
6 | 11 | - `nl2br()` is back as the primary name for "HTML-encode, then convert newlines to `<br>`". |
|
27 | 32 | a PHP warning and continuing with a null value |
28 | 33 | - `help()` is now static, so `SmartString::help()` (the documented form) and `$str->help()` |
29 | 34 | 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 |
30 | 37 | - `orDie()` exits with code 1 so CLI and cron callers see a failure exit code |
31 | 38 |
|
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 | | - |
36 | 39 | ### Removed |
37 | 40 | - `SmartString` constructor and `new()` no longer accept a `$properties` array - it only |
38 | 41 | carried the internal numeric-error flag, and nothing outside the class used it |
|
52 | 55 | 2. **Pre-2.6 `->nl2br()` chains** - `->nl2br()->value()` and similar now fail with "call to a |
53 | 56 | member function on string". Move chained methods before `->nl2br()`; it is a terminal call. |
54 | 57 |
|
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 | | - |
65 | 58 | ## [2.6.3] - 2026-04-27 |
66 | 59 | > **Bundled with CMS Builder v3.83** |
67 | 60 | > Roll-up release - every change from **v2.2.1 → v2.6.3** is now part of this version. |
|
0 commit comments