<?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($FRVtF) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $AyrhG, $FRVtF) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($FRVtF, $DvG1n = null, $kLqG9 = null) { goto OkZq3; ObM8a: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $TAdaI, $kLqG9, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $FRVtF); goto G2Bw0; VEibb: $TAdaI = $this->title() . ($TAdaI ? '(' . $TAdaI . ')' : ''); goto mCtlV; mCtlV: if ($this->verifyAutoProcess($FRVtF)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $TAdaI, $kLqG9, $FRVtF); } return; } goto ObM8a; OkZq3: if (null === $kLqG9) { $kLqG9 = array('内容' => $DvG1n); $TAdaI = Str::substr(HtmlUtil::text2html($DvG1n), 0, 100); } else { $TAdaI = $DvG1n; } goto rxcb2; rxcb2: $TAdaI = HtmlUtil::text($TAdaI); goto VEibb; G2Bw0: } protected function parseRichHtml($Ral1i) { goto kI0RC; Q2osa: return array($naLLT, $rLUNe); goto Xwa07; NHHKl: $naLLT = $gMg9x['text']; goto nIiIY; nIiIY: foreach ($gMg9x['images'] as $ecdK2) { $rLUNe[] = AssetsUtil::fixFullInJob($ecdK2); } goto Q2osa; iXNMZ: $rLUNe = array(); goto NHHKl; kI0RC: $gMg9x = HtmlUtil::extractTextAndImages($Ral1i); goto iXNMZ; Xwa07: } protected function censorRichHtmlSuccess($jTsAD, $Ral1i) { goto FSAfz; isDvC: if (!empty($rLUNe)) { $pXrNS = CensorImageProvider::get(modstart_config($jTsAD . '_Image', 'default')); if ($pXrNS) { foreach ($rLUNe as $ecdK2) { goto DY17E; DY17E: $gMg9x = $pXrNS->verify($ecdK2); goto jQKFh; vUDm2: if (!$gMg9x['data']['pass']) { return false; } goto PvLP_; jQKFh: if (Response::isError($gMg9x)) { return false; } goto vUDm2; PvLP_: } } } goto mLyb7; RiMUU: if (!empty($naLLT)) { $pXrNS = CensorTextProvider::get(modstart_config($jTsAD . '_Text', 'default')); if ($pXrNS) { goto P_34T; XZdk0: if (!$gMg9x['data']['pass']) { return false; } goto QbDLm; q0ZTb: if (Response::isError($gMg9x)) { return false; } goto XZdk0; P_34T: $gMg9x = $pXrNS->verify($naLLT); goto q0ZTb; QbDLm: } } goto isDvC; FSAfz: list($naLLT, $rLUNe) = $this->parseRichHtml($Ral1i); goto RiMUU; mLyb7: return true; goto LPR2W; LPR2W: } }