<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($V0Dls) { goto DrRKY; DrRKY: if (is_string($V0Dls)) { $V0Dls = trim($V0Dls); } goto kA6Xg; YJGmg: return $zBPGV; goto Mg8ia; K7iSr: $zBPGV = array(); goto fCXA6; fCXA6: foreach ($V0Dls as $zB1g3) { BizException::throwsIf('内容格式错误', empty($zB1g3['type'])); switch ($zB1g3['type']) { case 'text': goto un7Z6; un7Z6: BizException::throwsIf('内容格式错误', empty($zB1g3['data']['content'])); goto c1aF5; BQCNO: break; goto YCYk2; oJizu: $zBPGV[] = array('type' => $zB1g3['type'], 'data' => array('content' => $zB1g3['data']['content'])); goto BQCNO; c1aF5: BizException::throwsIf('内容格式错误', !is_string($zB1g3['data']['content'])); goto oJizu; YCYk2: case 'image': goto MWyM4; lWFrg: break; goto TOkAA; MWyM4: BizException::throwsIf('内容格式错误', empty($zB1g3['data']['image'])); goto gUKEU; cO8Bk: $zBPGV[] = array('type' => $zB1g3['type'], 'data' => array('image' => $zB1g3['data']['image'])); goto lWFrg; gUKEU: BizException::throwsIf('内容格式错误', !is_string($zB1g3['data']['image'])); goto cO8Bk; TOkAA: case 'images': goto a7kV0; ZM14Q: $e1qzy = array(); goto gHTu5; a7kV0: BizException::throwsIf('内容格式错误', empty($zB1g3['data']['images'])); goto NI1t6; gHTu5: foreach ($zB1g3['data']['images'] as $uKj64) { BizException::throwsIf('内容格式错误', !is_string($uKj64)); $e1qzy[] = $uKj64; } goto GmJkA; GmJkA: $zBPGV[] = array('type' => $zB1g3['type'], 'data' => array('images' => $e1qzy)); goto R3VoD; NI1t6: BizException::throwsIf('内容格式错误', !is_array($zB1g3['data']['images'])); goto ZM14Q; R3VoD: break; goto cxXFC; cxXFC: } } goto YJGmg; kA6Xg: if (is_string($V0Dls) && starts_with($V0Dls, '[')) { $V0Dls = @json_decode($V0Dls, true); } goto K7iSr; Mg8ia: } }