Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/lisk/LiskDAO.php
Show First 20 Lines • Show All 1,645 Lines • ▼ Show 20 Lines | if ($serialization) { | ||||
} else { | } else { | ||||
$data[$col] = serialize($data[$col]); | $data[$col] = serialize($data[$col]); | ||||
} | } | ||||
break; | break; | ||||
case self::SERIALIZATION_JSON: | case self::SERIALIZATION_JSON: | ||||
if ($deserialize) { | if ($deserialize) { | ||||
$data[$col] = json_decode($data[$col], true); | $data[$col] = json_decode($data[$col], true); | ||||
} else { | } else { | ||||
$data[$col] = json_encode($data[$col]); | $data[$col] = phutil_json_encode($data[$col]); | ||||
epriestley: This is the change which will make errors more obvious: the old call returns `false` for bad… | |||||
} | } | ||||
break; | break; | ||||
default: | default: | ||||
throw new Exception( | throw new Exception( | ||||
pht("Unknown serialization format '%s'.", $format)); | pht("Unknown serialization format '%s'.", $format)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |
This is the change which will make errors more obvious: the old call returns false for bad data, the new one throws.
The exception is pretty detailed so I think issues will be easy to fix, and these are all real (and potentially severe) bugs so we should definitely identify and fix them, but they may not occur in convenient places.