rename (un)serialise() -> json_(un)serialize()

This commit is contained in:
Mario
2025-11-21 20:43:35 +00:00
parent dcb09a8b39
commit 7fcc770fbf
10 changed files with 22 additions and 23 deletions

View File

@@ -4088,17 +4088,17 @@ function svg2bb($s) {
return EMPTY_STR;
}
function serialise($x) {
function json_serialize($x) {
return ((is_array($x)) ? 'json:' . json_encode($x) : $x);
}
function unserialise($x) {
function json_unserialize($x) {
if (is_array($x)) {
return $x;
}
$y = ((str_starts_with($x, 'json:')) ? json_decode(substr($x, 5), true) : '');
return ((is_array($y)) ? $y : $x);
}