<?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($mzzZ3) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $ukDy3, $mzzZ3) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($mzzZ3, $BRqP6 = null, $uilwH = null) { goto S4f27; XNKam: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $stCQl, $uilwH, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $mzzZ3); goto r0tDg; Hjewo: $stCQl = $this->title() . ($stCQl ? '(' . $stCQl . ')' : ''); goto Ltrsk; S4f27: if (null === $uilwH) { $uilwH = array('内容' => $BRqP6); $stCQl = Str::substr(HtmlUtil::text2html($BRqP6), 0, 100); } else { $stCQl = $BRqP6; } goto nXUJY; Ltrsk: if ($this->verifyAutoProcess($mzzZ3)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $stCQl, $uilwH, $mzzZ3); } return; } goto XNKam; nXUJY: $stCQl = HtmlUtil::text($stCQl); goto Hjewo; r0tDg: } protected function parseRichHtml($fKViA) { goto IxibC; uH5td: $InnN3 = array(); goto yiHxq; n67wG: return array($TsW1c, $InnN3); goto BnXCS; FIW11: foreach ($oHb9_['images'] as $O7O1_) { $InnN3[] = AssetsUtil::fixFullInJob($O7O1_); } goto n67wG; yiHxq: $TsW1c = $oHb9_['text']; goto FIW11; IxibC: $oHb9_ = HtmlUtil::extractTextAndImages($fKViA); goto uH5td; BnXCS: } protected function censorRichHtmlSuccess($s8KxK, $fKViA) { goto bRvNk; wewHq: if (!empty($InnN3)) { $tcA2a = CensorImageProvider::get(modstart_config($s8KxK . '_Image', 'default')); if ($tcA2a) { foreach ($InnN3 as $O7O1_) { goto APdrY; n1C_c: if (!$oHb9_['data']['pass']) { return false; } goto xiG2f; APdrY: $oHb9_ = $tcA2a->verify($O7O1_); goto LSNt5; LSNt5: if (Response::isError($oHb9_)) { return false; } goto n1C_c; xiG2f: } } } goto XQLgL; XQLgL: return true; goto aTP_P; bRvNk: list($TsW1c, $InnN3) = $this->parseRichHtml($fKViA); goto QDQxQ; QDQxQ: if (!empty($TsW1c)) { $tcA2a = CensorTextProvider::get(modstart_config($s8KxK . '_Text', 'default')); if ($tcA2a) { goto uNNbA; uNNbA: $oHb9_ = $tcA2a->verify($TsW1c); goto esYMk; xhRP3: if (!$oHb9_['data']['pass']) { return false; } goto H5c2e; esYMk: if (Response::isError($oHb9_)) { return false; } goto xhRP3; H5c2e: } } goto wewHq; aTP_P: } }