如何修复已被错误字节计数长度损坏的序列化字符串?
取消序列化()[功能.非序列化]:在偏移量处出错
/** * Retrieve submission step data * * @param $key - empty when setting * @return bool */ public function loadSubmitData($h, $key = '') { // delete everything in this table older than 30 minutes: $this->deleteTempData($h->db); if (!$key) { return false; } $cleanKey = preg_replace('/[^a-z0-9]+/','',$key); if (strcmp($key,$cleanKey) != 0) { return false; } else { $sql = "SELECT tempdata_value FROM " . TABLE_TEMPDATA . " WHERE tempdata_key = %s ORDER BY tempdata_updatedts DESC LIMIT 1"; $submitted_data = $h->db->get_var($h->db->prepare($sql, $key)); **if ($submitted_data) { return unserialize($submitted_data); } else { return false; }** } }
a:10:{s:16:"submit_editorial";b:0;s:15:"submit_orig_url";s:13:"www.bbc.co.uk";s:12:"submit_title";s:14:"No title found";s:14:"submit_ content";s:12:"dnfsdkfjdfdf";s:15:"submit_category";i:2;s:11:"submit_tags";s:3:"bbc";s:9:"submit_id";b:0;s:16:"submit_subscribe";i:0;s:15 :"submit_comments";s:4:"open";s:5:"image";s:19:"C:fakepath100.jpg";}
/** * Save submission step data * * @return bool */ public function saveSubmitData($h) { // delete everything in this table older than 30 minutes: $this->deleteTempData($h->db); $sid = preg_replace('/[^a-z0-9]+/i', '', session_id()); $key = md5(microtime() . $sid . rand()); $sql = "INSERT INTO " . TABLE_TEMPDATA . " (tempdata_key, tempdata_value, tempdata_updateby) VALUES (%s,%s, %d)"; $h->db->query($h->db->prepare($sql, $key, serialize($h->vars['submitted_data']), $h->currentUser->id)); return $key; }
素胚勾勒不出你
慕虎7371278