Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | util.format: Ensure metatable __tostring results are also sanitized | Kim Alvefur | 2021-12-13 | 1 | -0/+16 |
| | |||||
* | util.format: Fix some formats expecting positive numbers in Lua 5.2 | Kim Alvefur | 2021-12-11 | 1 | -4/+4 |
| | | | | Amazing how string.format behaves differently under each Lua version | ||||
* | util.format: ALL THE TESTS!!! | Kim Alvefur | 2021-12-11 | 1 | -0/+842 |
| | | | | | | The more tests I made, the more Lua 5.1 quirks I discovered. Tests generated using a tool plus some touch-up. | ||||
* | util.format: Also handle the %p format added in Lua 5.4 | Kim Alvefur | 2021-12-11 | 1 | -0/+9 |
| | |||||
* | util.format: Ensure sanitation of strings passed to wrong format | Kim Alvefur | 2021-12-11 | 1 | -0/+1 |
| | | | | | | | | | Ie. log("debug", "%d", "\1\2\3") should not result in garbage. Also optimizing for the common case of ASCII string passed to %s and early returns everywhere. Returning nil from a gsub callback keeps the original substring. | ||||
* | util.format: Escape invalid UTF-8 by passing trough serialization | Kim Alvefur | 2021-12-10 | 1 | -0/+4 |
| | | | | | | Should prevent invalid UTF-8 from making it into the logs, which can cause trouble with terminals or log viewers or other tools, such as when grep determines that log files are binary. | ||||
* | util.format: Change formatting of nil values to avoid looking like XML | Kim Alvefur | 2021-06-29 | 1 | -4/+4 |
| | |||||
* | util.format: Escape ASCII control characters in output | Kim Alvefur | 2021-06-15 | 1 | -0/+5 |
| | | | | | | | This should offer some protection against doing evil things to terminals. Doesn't protect against pure broken UTF-8 garbage however. See #734 | ||||
* | util.format: Handle integer formats the same way on Lua versions without ↵ | Kim Alvefur | 2019-05-30 | 1 | -0/+1 |
| | | | | integer support | ||||
* | util.format: Handle formats expecting an integer in Lua 5.3+ (fixes #1371) | Kim Alvefur | 2019-05-30 | 1 | -0/+1 |
| | |||||
* | util.format: Serialize values for the %q format | Kim Alvefur | 2018-10-12 | 1 | -0/+1 |
| | | | | Improves eg debug logs | ||||
* | util.format: Tweak how nil values are handled | Kim Alvefur | 2018-11-28 | 1 | -0/+2 |
| | | | | Because [<nil>] seems exsessive | ||||
* | util.format: Add test coverage for case of extra nil argument | Kim Alvefur | 2018-03-17 | 1 | -0/+1 |
| | |||||
* | util.format: Fix tests to have expected value first | Kim Alvefur | 2018-03-17 | 1 | -5/+5 |
| | |||||
* | util.format: Move tests to spec/ | Kim Alvefur | 2017-11-10 | 1 | -0/+13 |