<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; class ContentUtil { public static function parseEditorPlusContent($n16LT) { goto kMT37; a97DF: if (is_string($n16LT) && starts_with($n16LT, '[')) { $n16LT = @json_decode($n16LT, true); } goto H7ypn; kMT37: if (is_string($n16LT)) { $n16LT = trim($n16LT); } goto a97DF; TLbdG: return $bu01d; goto K5lh7; H7ypn: $bu01d = array(); goto sAiHl; sAiHl: foreach ($n16LT as $M0WVk) { BizException::throwsIf('内容格式错误', empty($M0WVk['type'])); switch ($M0WVk['type']) { case 'text': goto aNFzT; Y9TZB: BizException::throwsIf('内容格式错误', !is_string($M0WVk['data']['content'])); goto a2gSj; aNFzT: BizException::throwsIf('内容格式错误', empty($M0WVk['data']['content'])); goto Y9TZB; xVKaH: break; goto s7gfJ; a2gSj: $bu01d[] = array('type' => $M0WVk['type'], 'data' => array('content' => $M0WVk['data']['content'])); goto xVKaH; s7gfJ: case 'image': goto HI1Dx; wa0m5: BizException::throwsIf('内容格式错误', !is_string($M0WVk['data']['image'])); goto CyJ30; B7Chh: break; goto leKAy; CyJ30: $bu01d[] = array('type' => $M0WVk['type'], 'data' => array('image' => $M0WVk['data']['image'])); goto B7Chh; HI1Dx: BizException::throwsIf('内容格式错误', empty($M0WVk['data']['image'])); goto wa0m5; leKAy: case 'images': goto L7Wx6; vK2NM: BizException::throwsIf('内容格式错误', !is_array($M0WVk['data']['images'])); goto kXQ4y; WBeJM: break; goto xQ3vZ; oOJFW: $bu01d[] = array('type' => $M0WVk['type'], 'data' => array('images' => $ls0xp)); goto WBeJM; kXQ4y: $ls0xp = array(); goto DUaNO; L7Wx6: BizException::throwsIf('内容格式错误', empty($M0WVk['data']['images'])); goto vK2NM; DUaNO: foreach ($M0WVk['data']['images'] as $j2Tp6) { BizException::throwsIf('内容格式错误', !is_string($j2Tp6)); $ls0xp[] = $j2Tp6; } goto oOJFW; xQ3vZ: } } goto TLbdG; K5lh7: } }