<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($eTwx_) { goto khiEz; OAK5Y: return $cbHm3; goto BILhh; zdNrg: if (is_string($eTwx_) && starts_with($eTwx_, '[')) { $eTwx_ = @json_decode($eTwx_, true); } goto MCnqZ; ctCjg: foreach ($eTwx_ as $SJfZL) { BizException::throwsIf('内容格式错误', empty($SJfZL['type'])); switch ($SJfZL['type']) { case 'text': goto CRX0b; CRX0b: BizException::throwsIf('内容格式错误', empty($SJfZL['data']['content'])); goto orQMI; orQMI: BizException::throwsIf('内容格式错误', !is_string($SJfZL['data']['content'])); goto kS5nP; H3s_Q: break; goto Q6zO7; kS5nP: $cbHm3[] = array('type' => $SJfZL['type'], 'data' => array('content' => $SJfZL['data']['content'])); goto H3s_Q; Q6zO7: case 'image': goto E1Ees; uLc_2: BizException::throwsIf('内容格式错误', !is_string($SJfZL['data']['image'])); goto w_Y0J; jZ6KB: break; goto gaboA; w_Y0J: $cbHm3[] = array('type' => $SJfZL['type'], 'data' => array('image' => $SJfZL['data']['image'])); goto jZ6KB; E1Ees: BizException::throwsIf('内容格式错误', empty($SJfZL['data']['image'])); goto uLc_2; gaboA: case 'images': goto jAtjD; N7t3B: break; goto Gn0yx; aOuW7: foreach ($SJfZL['data']['images'] as $dpsOl) { BizException::throwsIf('内容格式错误', !is_string($dpsOl)); $Z5ROH[] = $dpsOl; } goto yw5y3; VJhYJ: BizException::throwsIf('内容格式错误', !is_array($SJfZL['data']['images'])); goto VHLj6; yw5y3: $cbHm3[] = array('type' => $SJfZL['type'], 'data' => array('images' => $Z5ROH)); goto N7t3B; VHLj6: $Z5ROH = array(); goto aOuW7; jAtjD: BizException::throwsIf('内容格式错误', empty($SJfZL['data']['images'])); goto VJhYJ; Gn0yx: } } goto OAK5Y; MCnqZ: $cbHm3 = array(); goto ctCjg; khiEz: if (is_string($eTwx_)) { $eTwx_ = trim($eTwx_); } goto zdNrg; BILhh: } }