mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 18:06:02 +00:00
82a07e1e35
Export now diffs the config against defaults and emits SerializeCBOR -> CompressString (zlib) -> EncodeBase64 with a "!pf1!" prefix. Import reverses that into a plain table — no loadstring, so a pasted profile is data and can't execute code. The Decode/Encode button converts blob <-> editable JSON (SerializeJSON/DeserializeJSON) for inspection and hand-edits. Old-format strings still import: standard base64 via DecodeBase64, the custom LZW decompressor kept import-only, and the resulting Lua source runs in an EMPTY setfenv sandbox that can only assign its config table. Decode on a legacy string yields the JSON view, so Encode re-emits it as a new-format blob (migration path). Roughly half the paste size of the old LZW format, C-speed instead of the old bit-string base64 (which froze the client on large configs), and the format is fully standard — external tools can decode profiles with stock base64/zlib/CBOR libraries. Requires ClassicAPI with the SerializeCBOR buffer-growth fix (payloads over 256 bytes returned nil before it).