<?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($EPwwc) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $s4jIj, $EPwwc) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($EPwwc, $WUQUn = null, $k05vF = null) { goto aDjKG; j8Rgm: if ($this->verifyAutoProcess($EPwwc)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $SboEP, $k05vF, $EPwwc); } return; } goto GmV1S; nfFOE: $SboEP = $this->title() . ($SboEP ? '(' . $SboEP . ')' : ''); goto j8Rgm; GmV1S: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $SboEP, $k05vF, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $EPwwc); goto OR3Dy; XF794: $SboEP = HtmlUtil::text($SboEP); goto nfFOE; aDjKG: if (null === $k05vF) { $k05vF = array('内容' => $WUQUn); $SboEP = Str::substr(HtmlUtil::text2html($WUQUn), 0, 100); } else { $SboEP = $WUQUn; } goto XF794; OR3Dy: } protected function parseRichHtml($MPmfx) { goto jashI; NTPwA: $Q1mbG = $Ecj99['text']; goto riIEY; jashI: $Ecj99 = HtmlUtil::extractTextAndImages($MPmfx); goto YJoUt; riIEY: foreach ($Ecj99['images'] as $CzRaU) { $sGafY[] = AssetsUtil::fixFullInJob($CzRaU); } goto FH4qS; YJoUt: $sGafY = array(); goto NTPwA; FH4qS: return array($Q1mbG, $sGafY); goto SvwYp; SvwYp: } protected function censorRichHtmlSuccess($szp1i, $MPmfx) { goto hjsXE; hjsXE: list($Q1mbG, $sGafY) = $this->parseRichHtml($MPmfx); goto YgnCE; YgnCE: if (!empty($Q1mbG)) { $O9Vtg = CensorTextProvider::get(modstart_config($szp1i . '_Text', 'default')); if ($O9Vtg) { goto EZAX5; EZAX5: $Ecj99 = $O9Vtg->verify($Q1mbG); goto dCv1v; LRTl8: if (!$Ecj99['data']['pass']) { return false; } goto dRCZ9; dCv1v: if (Response::isError($Ecj99)) { return false; } goto LRTl8; dRCZ9: } } goto NsU49; NsU49: if (!empty($sGafY)) { $O9Vtg = CensorImageProvider::get(modstart_config($szp1i . '_Image', 'default')); if ($O9Vtg) { foreach ($sGafY as $CzRaU) { goto er1VD; er1VD: $Ecj99 = $O9Vtg->verify($CzRaU); goto v7YWA; v7YWA: if (Response::isError($Ecj99)) { return false; } goto bLQd8; bLQd8: if (!$Ecj99['data']['pass']) { return false; } goto VIqgw; VIqgw: } } } goto hebEb; hebEb: return true; goto werKy; werKy: } }