<?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($EPwwc) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $s4jIj, $EPwwc) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($EPwwc, $WUQUn = null, $k05vF = null) { goto tcREK; tmYwS: $SboEP = HtmlUtil::text($SboEP); goto PDv8A; a02nG: if ($this->verifyAutoProcess($EPwwc)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $SboEP, $k05vF, $EPwwc); } return; } goto z2jSX; z2jSX: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $SboEP, $k05vF, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $EPwwc); goto sfMYp; tcREK: if (null === $k05vF) { $k05vF = array('内容' => $WUQUn); $SboEP = Str::substr(HtmlUtil::text2html($WUQUn), 0, 100); } else { $SboEP = $WUQUn; } goto tmYwS; PDv8A: $SboEP = $this->title() . ($SboEP ? '(' . $SboEP . ')' : ''); goto a02nG; sfMYp: } protected function parseRichHtml($MPmfx) { goto m28y3; Yag6X: $Q1mbG = $Ecj99['text']; goto qe9A5; ah6_j: $sGafY = array(); goto Yag6X; lzJEE: return array($Q1mbG, $sGafY); goto ie2cD; m28y3: $Ecj99 = HtmlUtil::extractTextAndImages($MPmfx); goto ah6_j; qe9A5: foreach ($Ecj99['images'] as $CzRaU) { $sGafY[] = AssetsUtil::fixFullInJob($CzRaU); } goto lzJEE; ie2cD: } protected function censorRichHtmlSuccess($szp1i, $MPmfx) { goto SALz3; NUMjq: if (!empty($sGafY)) { $O9Vtg = CensorImageProvider::get(modstart_config($szp1i . '_Image', 'default')); if ($O9Vtg) { foreach ($sGafY as $CzRaU) { goto XRSxm; XRSxm: $Ecj99 = $O9Vtg->verify($CzRaU); goto jXr7k; jXr7k: if (Response::isError($Ecj99)) { return false; } goto piK5o; piK5o: if (!$Ecj99['data']['pass']) { return false; } goto OdSeE; OdSeE: } } } goto D53OW; SALz3: list($Q1mbG, $sGafY) = $this->parseRichHtml($MPmfx); goto PBilJ; PBilJ: if (!empty($Q1mbG)) { $O9Vtg = CensorTextProvider::get(modstart_config($szp1i . '_Text', 'default')); if ($O9Vtg) { goto OWGjt; OWGjt: $Ecj99 = $O9Vtg->verify($Q1mbG); goto f_ftY; f_ftY: if (Response::isError($Ecj99)) { return false; } goto W3zwD; W3zwD: if (!$Ecj99['data']['pass']) { return false; } goto nh4cB; nh4cB: } } goto NUMjq; D53OW: return true; goto gqvNZ; gqvNZ: } }