第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何修復(fù)已被錯(cuò)誤字節(jié)計(jì)數(shù)長(zhǎng)度損壞的序列化字符串?

如何修復(fù)已被錯(cuò)誤字節(jié)計(jì)數(shù)長(zhǎng)度損壞的序列化字符串?

GCT1015 2019-07-06 15:43:27
如何修復(fù)已被錯(cuò)誤字節(jié)計(jì)數(shù)長(zhǎng)度損壞的序列化字符串?我使用的是Hotaru CMS和圖像上傳插件,如果我試圖將圖像附加到一個(gè)帖子中,我會(huì)得到這個(gè)錯(cuò)誤,否則沒(méi)有錯(cuò)誤:取消序列化()[功能.非序列化]:在偏移量處出錯(cuò)違規(guī)代碼(錯(cuò)誤點(diǎn)指向*):/**      * 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; }**          }     }數(shù)據(jù)從表,注意結(jié)束位有圖像信息,我不是一個(gè)PHP專(zhuān)家,所以我想知道你們這些家伙/女孩可能會(huì)怎么想?temdata_value: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;     }
查看完整描述

3 回答

?
素胚勾勒不出你

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超9個(gè)贊

我沒(méi)有足夠的聲譽(yù)來(lái)發(fā)表評(píng)論,所以我希望使用上述“正確”答案的人能看到這一點(diǎn):

由于php5.5,preg_reve()中的/e修飾符已被完全廢棄,上面的preg_Match將出錯(cuò)。php文檔建議在其位置使用preg_match_callback。

請(qǐng)找到以下解決方案,作為上述建議的preg_match的替代方案。

$fixed_data = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function($match) {      
    return ($match[1] == strlen($match[2])) ? $match[0] : 's:' . strlen($match[2]) . ':"' . $match[2] . '";';},$bad_data );


查看完整回答
反對(duì) 回復(fù) 2019-07-06
?
慕虎7371278

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超4個(gè)贊

還有另一個(gè)原因unserialize()失敗,因?yàn)槟徽_地將序列化的數(shù)據(jù)放入數(shù)據(jù)庫(kù)(請(qǐng)參閱官方解釋這里。自serialize()返回二進(jìn)制數(shù)據(jù)和php變量不關(guān)心編碼方法,因此將其放入文本中,VARCHAR()將導(dǎo)致此錯(cuò)誤。

解決方案:將序列化的數(shù)據(jù)存儲(chǔ)到表中的BLOB中。


查看完整回答
反對(duì) 回復(fù) 2019-07-06
  • 3 回答
  • 0 關(guān)注
  • 629 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)