<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($OfwYj) { goto JigIe; a1fe2: $bWyIm = array(); goto qi4hs; JigIe: if (is_string($OfwYj)) { $OfwYj = trim($OfwYj); } goto nEBGs; nEBGs: if (is_string($OfwYj) && starts_with($OfwYj, '[')) { $OfwYj = @json_decode($OfwYj, true); } goto a1fe2; wFHvY: return $bWyIm; goto mE2V1; qi4hs: foreach ($OfwYj as $J03ZP) { BizException::throwsIf('内容格式错误', empty($J03ZP['type'])); switch ($J03ZP['type']) { case 'text': goto CtQIr; THGxh: BizException::throwsIf('内容格式错误', !is_string($J03ZP['data']['content'])); goto ZEYw6; Zfs4q: break; goto ES1Az; ZEYw6: $bWyIm[] = array('type' => $J03ZP['type'], 'data' => array('content' => $J03ZP['data']['content'])); goto Zfs4q; CtQIr: BizException::throwsIf('内容格式错误', empty($J03ZP['data']['content'])); goto THGxh; ES1Az: case 'image': goto SeWU1; J9guB: $bWyIm[] = array('type' => $J03ZP['type'], 'data' => array('image' => $J03ZP['data']['image'])); goto S0bG5; S0bG5: break; goto VaKRt; OUY5J: BizException::throwsIf('内容格式错误', !is_string($J03ZP['data']['image'])); goto J9guB; SeWU1: BizException::throwsIf('内容格式错误', empty($J03ZP['data']['image'])); goto OUY5J; VaKRt: case 'images': goto D1fOI; BVFIf: BizException::throwsIf('内容格式错误', !is_array($J03ZP['data']['images'])); goto lJ8JK; grxbH: foreach ($J03ZP['data']['images'] as $S5EW1) { BizException::throwsIf('内容格式错误', !is_string($S5EW1)); $YO0Qh[] = $S5EW1; } goto WkHmT; WkHmT: $bWyIm[] = array('type' => $J03ZP['type'], 'data' => array('images' => $YO0Qh)); goto bQEs4; bQEs4: break; goto Sa77Q; D1fOI: BizException::throwsIf('内容格式错误', empty($J03ZP['data']['images'])); goto BVFIf; lJ8JK: $YO0Qh = array(); goto grxbH; Sa77Q: } } goto wFHvY; mE2V1: } }