Switch from deprecated escape()/unescape() methods to custom encode_data()/decode_data() functions