<?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($uxJUJ) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $hUMbi, $uxJUJ) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($uxJUJ, $SLZ1j = null, $yGKLN = null) { goto L5Bgu; ZsKr5: $YnAJ0 = $this->title() . ($YnAJ0 ? '(' . $YnAJ0 . ')' : ''); goto GSFdB; GSFdB: if ($this->verifyAutoProcess($uxJUJ)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $YnAJ0, $yGKLN, $uxJUJ); } return; } goto ZRbau; ZRbau: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $YnAJ0, $yGKLN, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $uxJUJ); goto CMlas; L5Bgu: if (null === $yGKLN) { $yGKLN = array('内容' => $SLZ1j); $YnAJ0 = Str::substr(HtmlUtil::text2html($SLZ1j), 0, 100); } else { $YnAJ0 = $SLZ1j; } goto gxsZ9; gxsZ9: $YnAJ0 = HtmlUtil::text($YnAJ0); goto ZsKr5; CMlas: } protected function parseRichHtml($V0Dls) { goto WwwKl; O8Yx4: $e1qzy = array(); goto nPgKh; nPgKh: $jzB3x = $ZrjxR['text']; goto AnQpc; AnQpc: foreach ($ZrjxR['images'] as $uKj64) { $e1qzy[] = AssetsUtil::fixFullInJob($uKj64); } goto PZEKG; PZEKG: return array($jzB3x, $e1qzy); goto Rh9UB; WwwKl: $ZrjxR = HtmlUtil::extractTextAndImages($V0Dls); goto O8Yx4; Rh9UB: } protected function censorRichHtmlSuccess($PzgJv, $V0Dls) { goto ijh9J; YtehI: if (!empty($e1qzy)) { $kHDkQ = CensorImageProvider::get(modstart_config($PzgJv . '_Image', 'default')); if ($kHDkQ) { foreach ($e1qzy as $uKj64) { goto Cummd; zXCfs: if (Response::isError($ZrjxR)) { return false; } goto CEjm_; Cummd: $ZrjxR = $kHDkQ->verify($uKj64); goto zXCfs; CEjm_: if (!$ZrjxR['data']['pass']) { return false; } goto wTZIv; wTZIv: } } } goto rLT20; rLT20: return true; goto e5C6c; pIYjM: if (!empty($jzB3x)) { $kHDkQ = CensorTextProvider::get(modstart_config($PzgJv . '_Text', 'default')); if ($kHDkQ) { goto Nxcd_; Sjqw1: if (!$ZrjxR['data']['pass']) { return false; } goto gnR3r; Nxcd_: $ZrjxR = $kHDkQ->verify($jzB3x); goto mzvyE; mzvyE: if (Response::isError($ZrjxR)) { return false; } goto Sjqw1; gnR3r: } } goto YtehI; ijh9J: list($jzB3x, $e1qzy) = $this->parseRichHtml($V0Dls); goto pIYjM; e5C6c: } }