<?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($KJ3xr) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $OkcU0, $KJ3xr) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($KJ3xr, $MNqDV = null, $ZI5AS = null) { goto FsTpO; FsTpO: if (null === $ZI5AS) { $ZI5AS = array('内容' => $MNqDV); $Ldwxu = Str::substr(HtmlUtil::text2html($MNqDV), 0, 100); } else { $Ldwxu = $MNqDV; } goto QELKz; IxzTE: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $Ldwxu, $ZI5AS, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $KJ3xr); goto RXodd; oVlBQ: $Ldwxu = $this->title() . ($Ldwxu ? '(' . $Ldwxu . ')' : ''); goto DdBjF; QELKz: $Ldwxu = HtmlUtil::text($Ldwxu); goto oVlBQ; DdBjF: if ($this->verifyAutoProcess($KJ3xr)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $Ldwxu, $ZI5AS, $KJ3xr); } return; } goto IxzTE; RXodd: } protected function parseRichHtml($eTwx_) { goto jGjwQ; RqX8d: foreach ($Gs3Xd['images'] as $dpsOl) { $Z5ROH[] = AssetsUtil::fixFullInJob($dpsOl); } goto NII6l; wkbXX: $Ia38Z = $Gs3Xd['text']; goto RqX8d; jGjwQ: $Gs3Xd = HtmlUtil::extractTextAndImages($eTwx_); goto W_r8q; W_r8q: $Z5ROH = array(); goto wkbXX; NII6l: return array($Ia38Z, $Z5ROH); goto LKBum; LKBum: } protected function censorRichHtmlSuccess($fkBNW, $eTwx_) { goto WOWc3; o4iAl: if (!empty($Ia38Z)) { $sefXk = CensorTextProvider::get(modstart_config($fkBNW . '_Text', 'default')); if ($sefXk) { goto ycI8T; ycI8T: $Gs3Xd = $sefXk->verify($Ia38Z); goto rVlXq; rVlXq: if (Response::isError($Gs3Xd)) { return false; } goto dVVCm; dVVCm: if (!$Gs3Xd['data']['pass']) { return false; } goto Swqqg; Swqqg: } } goto xUYoV; xUYoV: if (!empty($Z5ROH)) { $sefXk = CensorImageProvider::get(modstart_config($fkBNW . '_Image', 'default')); if ($sefXk) { foreach ($Z5ROH as $dpsOl) { goto y1jU8; JrLM5: if (!$Gs3Xd['data']['pass']) { return false; } goto lj4JJ; y1jU8: $Gs3Xd = $sefXk->verify($dpsOl); goto eAKrZ; eAKrZ: if (Response::isError($Gs3Xd)) { return false; } goto JrLM5; lj4JJ: } } } goto wOwVx; wOwVx: return true; goto wsiWI; WOWc3: list($Ia38Z, $Z5ROH) = $this->parseRichHtml($eTwx_); goto o4iAl; wsiWI: } }