<?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 AbstractContentVerifyProvider { 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 QdhWD; QdhWD: if (null === $kLqG9) { $kLqG9 = array('内容' => $DvG1n); $TAdaI = Str::substr(HtmlUtil::text2html($DvG1n), 0, 100); } else { $TAdaI = $DvG1n; } goto cfIWC; APkXG: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $TAdaI, $kLqG9, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $FRVtF); goto lr5Zh; PZNCU: if ($this->verifyAutoProcess($FRVtF)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $TAdaI, $kLqG9, $FRVtF); } return; } goto APkXG; Eq3Ye: $TAdaI = $this->title() . ($TAdaI ? '(' . $TAdaI . ')' : ''); goto PZNCU; cfIWC: $TAdaI = HtmlUtil::text($TAdaI); goto Eq3Ye; lr5Zh: } protected function parseRichHtml($Ral1i) { goto ZHQSX; tHijZ: $rLUNe = array(); goto KnMDb; KnMDb: $naLLT = $gMg9x['text']; goto OWhi1; ZHQSX: $gMg9x = HtmlUtil::extractTextAndImages($Ral1i); goto tHijZ; OWhi1: foreach ($gMg9x['images'] as $ecdK2) { $rLUNe[] = AssetsUtil::fixFullInJob($ecdK2); } goto j3QeG; j3QeG: return array($naLLT, $rLUNe); goto EuF4w; EuF4w: } protected function censorRichHtmlSuccess($jTsAD, $Ral1i) { goto QgJcR; qj3T3: return true; goto VmCiE; USV22: if (!empty($naLLT)) { $pXrNS = CensorTextProvider::get(modstart_config($jTsAD . '_Text', 'default')); if ($pXrNS) { goto E0euc; QnS6F: if (Response::isError($gMg9x)) { return false; } goto GTeDh; E0euc: $gMg9x = $pXrNS->verify($naLLT); goto QnS6F; GTeDh: if (!$gMg9x['data']['pass']) { return false; } goto DEdzN; DEdzN: } } goto GCz1L; QgJcR: list($naLLT, $rLUNe) = $this->parseRichHtml($Ral1i); goto USV22; GCz1L: if (!empty($rLUNe)) { $pXrNS = CensorImageProvider::get(modstart_config($jTsAD . '_Image', 'default')); if ($pXrNS) { foreach ($rLUNe as $ecdK2) { goto V9tRI; q2JlN: if (!$gMg9x['data']['pass']) { return false; } goto NNtrG; OpHLo: if (Response::isError($gMg9x)) { return false; } goto q2JlN; V9tRI: $gMg9x = $pXrNS->verify($ecdK2); goto OpHLo; NNtrG: } } } goto qj3T3; VmCiE: } }