<?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($qOrzw) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $yZTO2, $qOrzw) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($qOrzw, $yP0KF = null, $cllT8 = null) { goto qz_RP; jfvvH: $fJvBq = $this->title() . ($fJvBq ? '(' . $fJvBq . ')' : ''); goto dvxN1; YIFoS: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $fJvBq, $cllT8, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $qOrzw); goto x9AJp; viHMH: $fJvBq = HtmlUtil::text($fJvBq); goto jfvvH; qz_RP: if (null === $cllT8) { $cllT8 = array('内容' => $yP0KF); $fJvBq = Str::substr(HtmlUtil::text2html($yP0KF), 0, 100); } else { $fJvBq = $yP0KF; } goto viHMH; dvxN1: if ($this->verifyAutoProcess($qOrzw)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $fJvBq, $cllT8, $qOrzw); } return; } goto YIFoS; x9AJp: } protected function parseRichHtml($n16LT) { goto dWH5C; EPwk3: foreach ($Tbn6c['images'] as $j2Tp6) { $ls0xp[] = AssetsUtil::fixFullInJob($j2Tp6); } goto Dds3x; pJC5C: $ev9nD = $Tbn6c['text']; goto EPwk3; dWH5C: $Tbn6c = HtmlUtil::extractTextAndImages($n16LT); goto V_Zto; Dds3x: return array($ev9nD, $ls0xp); goto oX4No; V_Zto: $ls0xp = array(); goto pJC5C; oX4No: } protected function censorRichHtmlSuccess($wgFKE, $n16LT) { goto e1QqH; L9daM: if (!empty($ev9nD)) { $oMd7I = CensorTextProvider::get(modstart_config($wgFKE . '_Text', 'default')); if ($oMd7I) { goto O42mn; pliKL: if (!$Tbn6c['data']['pass']) { return false; } goto y09ou; O42mn: $Tbn6c = $oMd7I->verify($ev9nD); goto xX8jl; xX8jl: if (Response::isError($Tbn6c)) { return false; } goto pliKL; y09ou: } } goto HyH1u; JdLtw: return true; goto Z0tia; HyH1u: if (!empty($ls0xp)) { $oMd7I = CensorImageProvider::get(modstart_config($wgFKE . '_Image', 'default')); if ($oMd7I) { foreach ($ls0xp as $j2Tp6) { goto jCIVO; jCIVO: $Tbn6c = $oMd7I->verify($j2Tp6); goto KKi3Y; NaIfn: if (!$Tbn6c['data']['pass']) { return false; } goto ZuQEd; KKi3Y: if (Response::isError($Tbn6c)) { return false; } goto NaIfn; ZuQEd: } } } goto JdLtw; e1QqH: list($ev9nD, $ls0xp) = $this->parseRichHtml($n16LT); goto L9daM; Z0tia: } }