<?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($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 HuB18; mrdhP: $YnAJ0 = HtmlUtil::text($YnAJ0); goto WNY3a; HuB18: if (null === $yGKLN) { $yGKLN = array('内容' => $SLZ1j); $YnAJ0 = Str::substr(HtmlUtil::text2html($SLZ1j), 0, 100); } else { $YnAJ0 = $SLZ1j; } goto mrdhP; cq5PB: if ($this->verifyAutoProcess($uxJUJ)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $YnAJ0, $yGKLN, $uxJUJ); } return; } goto emsYA; WNY3a: $YnAJ0 = $this->title() . ($YnAJ0 ? '(' . $YnAJ0 . ')' : ''); goto cq5PB; emsYA: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $YnAJ0, $yGKLN, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $uxJUJ); goto oVDFq; oVDFq: } protected function parseRichHtml($V0Dls) { goto TnqgU; Alahy: $e1qzy = array(); goto wzuQ_; wzuQ_: $jzB3x = $ZrjxR['text']; goto Lnqck; iBpx4: return array($jzB3x, $e1qzy); goto iyEgK; TnqgU: $ZrjxR = HtmlUtil::extractTextAndImages($V0Dls); goto Alahy; Lnqck: foreach ($ZrjxR['images'] as $uKj64) { $e1qzy[] = AssetsUtil::fixFullInJob($uKj64); } goto iBpx4; iyEgK: } protected function censorRichHtmlSuccess($PzgJv, $V0Dls) { goto T6PWy; SmAmL: if (!empty($e1qzy)) { $kHDkQ = CensorImageProvider::get(modstart_config($PzgJv . '_Image', 'default')); if ($kHDkQ) { foreach ($e1qzy as $uKj64) { goto tw45z; QmDDB: if (Response::isError($ZrjxR)) { return false; } goto IVYxd; IVYxd: if (!$ZrjxR['data']['pass']) { return false; } goto MkTfA; tw45z: $ZrjxR = $kHDkQ->verify($uKj64); goto QmDDB; MkTfA: } } } goto ryv5o; zuuEp: if (!empty($jzB3x)) { $kHDkQ = CensorTextProvider::get(modstart_config($PzgJv . '_Text', 'default')); if ($kHDkQ) { goto r1F36; r1F36: $ZrjxR = $kHDkQ->verify($jzB3x); goto IdWTq; IdWTq: if (Response::isError($ZrjxR)) { return false; } goto VcIpw; VcIpw: if (!$ZrjxR['data']['pass']) { return false; } goto TEhS9; TEhS9: } } goto SmAmL; T6PWy: list($jzB3x, $e1qzy) = $this->parseRichHtml($V0Dls); goto zuuEp; ryv5o: return true; goto M6_2O; M6_2O: } }