<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\ContentVerify; use Illuminate\Support\Str; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Input\Response; use ModStart\Core\Util\HtmlUtil; use ModStart\Form\Form; use Module\Vendor\Provider\CensorImage\CensorImageProvider; use Module\Vendor\Provider\CensorText\CensorTextProvider; use Module\Vendor\Provider\Notifier\NotifierProvider; abstract class AbstractContentVerifyBiz { public abstract function name(); public abstract function title(); public function verifyAutoProcess($quZRe) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $l3dqy, $quZRe) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($quZRe, $oa5ye = null, $amxbk = null) { goto J9Ebw; MBXu5: if ($this->verifyAutoProcess($quZRe)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $YUOtR, $amxbk, $quZRe); } return; } goto LbeJE; LbeJE: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $YUOtR, $amxbk, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $quZRe); goto evwCz; xI98F: $YUOtR = $this->title() . ($YUOtR ? '(' . $YUOtR . ')' : ''); goto MBXu5; J9Ebw: if (null === $amxbk) { $amxbk = array('内容' => $oa5ye); $YUOtR = Str::substr(HtmlUtil::text2html($oa5ye), 0, 100); } else { $YUOtR = $oa5ye; } goto Vfy5a; Vfy5a: $YUOtR = HtmlUtil::text($YUOtR); goto xI98F; evwCz: } protected function parseRichHtml($OfwYj) { goto I2DVH; I2DVH: $om_hh = HtmlUtil::extractTextAndImages($OfwYj); goto YXnV_; VyCZH: $kFngB = $om_hh['text']; goto lyYqB; lyYqB: foreach ($om_hh['images'] as $S5EW1) { $YO0Qh[] = AssetsUtil::fixFullInJob($S5EW1); } goto ogPmi; ogPmi: return array($kFngB, $YO0Qh); goto GTnMy; YXnV_: $YO0Qh = array(); goto VyCZH; GTnMy: } protected function censorRichHtmlSuccess($z3TaD, $OfwYj) { goto hWQrX; ztmDj: if (!empty($YO0Qh)) { $yzKqK = CensorImageProvider::get(modstart_config($z3TaD . '_Image', 'default')); if ($yzKqK) { foreach ($YO0Qh as $S5EW1) { goto CBSPP; CBSPP: $om_hh = $yzKqK->verify($S5EW1); goto ExapM; u0YzB: if (!$om_hh['data']['pass']) { return false; } goto G2n1Y; ExapM: if (Response::isError($om_hh)) { return false; } goto u0YzB; G2n1Y: } } } goto KyRnQ; XxO0t: if (!empty($kFngB)) { $yzKqK = CensorTextProvider::get(modstart_config($z3TaD . '_Text', 'default')); if ($yzKqK) { goto INrkZ; CgmnZ: if (!$om_hh['data']['pass']) { return false; } goto b28mg; INrkZ: $om_hh = $yzKqK->verify($kFngB); goto oyUcH; oyUcH: if (Response::isError($om_hh)) { return false; } goto CgmnZ; b28mg: } } goto ztmDj; hWQrX: list($kFngB, $YO0Qh) = $this->parseRichHtml($OfwYj); goto XxO0t; KyRnQ: return true; goto Er2u3; Er2u3: } }