<?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($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 C7S74; TCcZV: $Ldwxu = HtmlUtil::text($Ldwxu); goto g8SE2; swNX2: if ($this->verifyAutoProcess($KJ3xr)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $Ldwxu, $ZI5AS, $KJ3xr); } return; } goto uKyZ7; C7S74: if (null === $ZI5AS) { $ZI5AS = array('内容' => $MNqDV); $Ldwxu = Str::substr(HtmlUtil::text2html($MNqDV), 0, 100); } else { $Ldwxu = $MNqDV; } goto TCcZV; g8SE2: $Ldwxu = $this->title() . ($Ldwxu ? '(' . $Ldwxu . ')' : ''); goto swNX2; uKyZ7: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $Ldwxu, $ZI5AS, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $KJ3xr); goto U3c2D; U3c2D: } protected function parseRichHtml($eTwx_) { goto yHSsq; RyIY2: return array($Ia38Z, $Z5ROH); goto cJ9ax; BKI3_: foreach ($Gs3Xd['images'] as $dpsOl) { $Z5ROH[] = AssetsUtil::fixFullInJob($dpsOl); } goto RyIY2; FhlrT: $Ia38Z = $Gs3Xd['text']; goto BKI3_; i_fDp: $Z5ROH = array(); goto FhlrT; yHSsq: $Gs3Xd = HtmlUtil::extractTextAndImages($eTwx_); goto i_fDp; cJ9ax: } protected function censorRichHtmlSuccess($fkBNW, $eTwx_) { goto urdYD; u4M6S: if (!empty($Z5ROH)) { $sefXk = CensorImageProvider::get(modstart_config($fkBNW . '_Image', 'default')); if ($sefXk) { foreach ($Z5ROH as $dpsOl) { goto o49ke; aiCMw: if (Response::isError($Gs3Xd)) { return false; } goto SrLDc; o49ke: $Gs3Xd = $sefXk->verify($dpsOl); goto aiCMw; SrLDc: if (!$Gs3Xd['data']['pass']) { return false; } goto NL06F; NL06F: } } } goto bgwJx; urdYD: list($Ia38Z, $Z5ROH) = $this->parseRichHtml($eTwx_); goto BBL3z; bgwJx: return true; goto hDBaE; BBL3z: if (!empty($Ia38Z)) { $sefXk = CensorTextProvider::get(modstart_config($fkBNW . '_Text', 'default')); if ($sefXk) { goto J1u6U; LKPWo: if (!$Gs3Xd['data']['pass']) { return false; } goto PLFCE; n6MhY: if (Response::isError($Gs3Xd)) { return false; } goto LKPWo; J1u6U: $Gs3Xd = $sefXk->verify($Ia38Z); goto n6MhY; PLFCE: } } goto u4M6S; hDBaE: } }