<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($Ral1i) { goto tGhcK; ZfdOT: return $FdfN8; goto lcedN; JnrHi: $FdfN8 = array(); goto ZsxAW; tGhcK: if (is_string($Ral1i)) { $Ral1i = trim($Ral1i); } goto qEor3; qEor3: if (is_string($Ral1i) && starts_with($Ral1i, '[')) { $Ral1i = @json_decode($Ral1i, true); } goto JnrHi; ZsxAW: foreach ($Ral1i as $ZIYgy) { BizException::throwsIf('内容格式错误', empty($ZIYgy['type'])); switch ($ZIYgy['type']) { case 'text': goto sV2RA; sV2RA: BizException::throwsIf('内容格式错误', empty($ZIYgy['data']['content'])); goto DSPiY; OFk6C: $FdfN8[] = array('type' => $ZIYgy['type'], 'data' => array('content' => $ZIYgy['data']['content'])); goto UMPU3; UMPU3: break; goto fsi6M; DSPiY: BizException::throwsIf('内容格式错误', !is_string($ZIYgy['data']['content'])); goto OFk6C; fsi6M: case 'image': goto fqZVO; tjNJT: break; goto d5Clq; fqZVO: BizException::throwsIf('内容格式错误', empty($ZIYgy['data']['image'])); goto TXcCk; TXcCk: BizException::throwsIf('内容格式错误', !is_string($ZIYgy['data']['image'])); goto ulqc_; ulqc_: $FdfN8[] = array('type' => $ZIYgy['type'], 'data' => array('image' => $ZIYgy['data']['image'])); goto tjNJT; d5Clq: case 'images': goto IFGGX; oo7en: $FdfN8[] = array('type' => $ZIYgy['type'], 'data' => array('images' => $rLUNe)); goto G_Avb; JQrZ2: BizException::throwsIf('内容格式错误', !is_array($ZIYgy['data']['images'])); goto sYZhA; IFGGX: BizException::throwsIf('内容格式错误', empty($ZIYgy['data']['images'])); goto JQrZ2; sYZhA: $rLUNe = array(); goto c7ZR6; G_Avb: break; goto JrXmZ; c7ZR6: foreach ($ZIYgy['data']['images'] as $ecdK2) { BizException::throwsIf('内容格式错误', !is_string($ecdK2)); $rLUNe[] = $ecdK2; } goto oo7en; JrXmZ: } } goto ZfdOT; lcedN: } }