<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($fKViA) { goto viaXO; viaXO: if (is_string($fKViA)) { $fKViA = trim($fKViA); } goto i9tC2; b5jNK: $q81IC = array(); goto a1w43; RD_5a: return $q81IC; goto oSKku; i9tC2: if (is_string($fKViA) && starts_with($fKViA, '[')) { $fKViA = @json_decode($fKViA, true); } goto b5jNK; a1w43: foreach ($fKViA as $m3pn4) { BizException::throwsIf('内容格式错误', empty($m3pn4['type'])); switch ($m3pn4['type']) { case 'text': goto B8v0M; B8v0M: BizException::throwsIf('内容格式错误', empty($m3pn4['data']['content'])); goto Et4no; CZKdk: break; goto mDtSz; BowW9: $q81IC[] = array('type' => $m3pn4['type'], 'data' => array('content' => $m3pn4['data']['content'])); goto CZKdk; Et4no: BizException::throwsIf('内容格式错误', !is_string($m3pn4['data']['content'])); goto BowW9; mDtSz: case 'image': goto g082b; f2_yW: break; goto pLcB_; cQQsC: $q81IC[] = array('type' => $m3pn4['type'], 'data' => array('image' => $m3pn4['data']['image'])); goto f2_yW; zZfD5: BizException::throwsIf('内容格式错误', !is_string($m3pn4['data']['image'])); goto cQQsC; g082b: BizException::throwsIf('内容格式错误', empty($m3pn4['data']['image'])); goto zZfD5; pLcB_: case 'images': goto X6iNM; g1U9Z: BizException::throwsIf('内容格式错误', !is_array($m3pn4['data']['images'])); goto by0Ie; bDPx0: foreach ($m3pn4['data']['images'] as $O7O1_) { BizException::throwsIf('内容格式错误', !is_string($O7O1_)); $InnN3[] = $O7O1_; } goto YufVb; by0Ie: $InnN3 = array(); goto bDPx0; X6iNM: BizException::throwsIf('内容格式错误', empty($m3pn4['data']['images'])); goto g1U9Z; QpCk6: break; goto nDY9j; YufVb: $q81IC[] = array('type' => $m3pn4['type'], 'data' => array('images' => $InnN3)); goto QpCk6; nDY9j: } } goto RD_5a; oSKku: } }