<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($ybjC4) { goto D2UIk; rGbcC: if (is_string($ybjC4) && starts_with($ybjC4, '[')) { $ybjC4 = @json_decode($ybjC4, true); } goto CVwJV; D2UIk: if (is_string($ybjC4)) { $ybjC4 = trim($ybjC4); } goto rGbcC; ddqM8: return $mHisM; goto wgs6g; CVwJV: $mHisM = array(); goto fGNtv; fGNtv: foreach ($ybjC4 as $vetOJ) { BizException::throwsIf('内容格式错误', empty($vetOJ['type'])); switch ($vetOJ['type']) { case 'text': goto FyjdW; Hx1Ab: BizException::throwsIf('内容格式错误', !is_string($vetOJ['data']['content'])); goto Cet93; Cet93: $mHisM[] = array('type' => $vetOJ['type'], 'data' => array('content' => $vetOJ['data']['content'])); goto CpHJi; FyjdW: BizException::throwsIf('内容格式错误', empty($vetOJ['data']['content'])); goto Hx1Ab; CpHJi: break; goto CDYXy; CDYXy: case 'image': goto GvQr4; qTlf5: BizException::throwsIf('内容格式错误', !is_string($vetOJ['data']['image'])); goto cZx25; cZx25: $mHisM[] = array('type' => $vetOJ['type'], 'data' => array('image' => $vetOJ['data']['image'])); goto ZAZ9h; ZAZ9h: break; goto JoyHL; GvQr4: BizException::throwsIf('内容格式错误', empty($vetOJ['data']['image'])); goto qTlf5; JoyHL: case 'images': goto i6vAy; i6vAy: BizException::throwsIf('内容格式错误', empty($vetOJ['data']['images'])); goto Cwjj2; LSXAo: $mHisM[] = array('type' => $vetOJ['type'], 'data' => array('images' => $ZAK__)); goto KyX5e; kkHPN: $ZAK__ = array(); goto kGGYu; kGGYu: foreach ($vetOJ['data']['images'] as $ICUxJ) { BizException::throwsIf('内容格式错误', !is_string($ICUxJ)); $ZAK__[] = $ICUxJ; } goto LSXAo; Cwjj2: BizException::throwsIf('内容格式错误', !is_array($vetOJ['data']['images'])); goto kkHPN; KyX5e: break; goto U4QpT; U4QpT: } } goto ddqM8; wgs6g: } }