<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($ZA40Q) { goto a0GKA; a0GKA: if (is_string($ZA40Q)) { $ZA40Q = trim($ZA40Q); } goto Co90n; Sr1GB: return $roX32; goto O96fj; Co90n: if (is_string($ZA40Q) && starts_with($ZA40Q, '[')) { $ZA40Q = @json_decode($ZA40Q, true); } goto q4VcN; qlNKB: foreach ($ZA40Q as $IeOEl) { BizException::throwsIf('内容格式错误', empty($IeOEl['type'])); switch ($IeOEl['type']) { case 'text': goto xOBZX; aZLf9: break; goto vZu80; xOBZX: BizException::throwsIf('内容格式错误', empty($IeOEl['data']['content'])); goto mCusS; FiRIf: $roX32[] = array('type' => $IeOEl['type'], 'data' => array('content' => $IeOEl['data']['content'])); goto aZLf9; mCusS: BizException::throwsIf('内容格式错误', !is_string($IeOEl['data']['content'])); goto FiRIf; vZu80: case 'image': goto B6Pal; wWpqW: $roX32[] = array('type' => $IeOEl['type'], 'data' => array('image' => $IeOEl['data']['image'])); goto tD2Bo; tD2Bo: break; goto Xg2GZ; DwjQY: BizException::throwsIf('内容格式错误', !is_string($IeOEl['data']['image'])); goto wWpqW; B6Pal: BizException::throwsIf('内容格式错误', empty($IeOEl['data']['image'])); goto DwjQY; Xg2GZ: case 'images': goto goZMN; goZMN: BizException::throwsIf('内容格式错误', empty($IeOEl['data']['images'])); goto b7Oyn; b7Oyn: BizException::throwsIf('内容格式错误', !is_array($IeOEl['data']['images'])); goto elglS; E0bVL: break; goto BqahN; WDkBm: $roX32[] = array('type' => $IeOEl['type'], 'data' => array('images' => $kE4Cx)); goto E0bVL; honJ4: foreach ($IeOEl['data']['images'] as $MjcZT) { BizException::throwsIf('内容格式错误', !is_string($MjcZT)); $kE4Cx[] = $MjcZT; } goto WDkBm; elglS: $kE4Cx = array(); goto honJ4; BqahN: } } goto Sr1GB; q4VcN: $roX32 = array(); goto qlNKB; O96fj: } }