<?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($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 twZWI; epc97: $stCQl = HtmlUtil::text($stCQl); goto meT67; twZWI: if (null === $uilwH) { $uilwH = array('内容' => $BRqP6); $stCQl = Str::substr(HtmlUtil::text2html($BRqP6), 0, 100); } else { $stCQl = $BRqP6; } goto epc97; z6dCf: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $stCQl, $uilwH, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $mzzZ3); goto ixxaU; ifNZ7: if ($this->verifyAutoProcess($mzzZ3)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $stCQl, $uilwH, $mzzZ3); } return; } goto z6dCf; meT67: $stCQl = $this->title() . ($stCQl ? '(' . $stCQl . ')' : ''); goto ifNZ7; ixxaU: } protected function parseRichHtml($fKViA) { goto CogMp; CogMp: $oHb9_ = HtmlUtil::extractTextAndImages($fKViA); goto i7r3Y; i7r3Y: $InnN3 = array(); goto cijx0; Qvddo: foreach ($oHb9_['images'] as $O7O1_) { $InnN3[] = AssetsUtil::fixFullInJob($O7O1_); } goto hyOSV; cijx0: $TsW1c = $oHb9_['text']; goto Qvddo; hyOSV: return array($TsW1c, $InnN3); goto GQlEx; GQlEx: } protected function censorRichHtmlSuccess($s8KxK, $fKViA) { goto lQK9x; tCigE: return true; goto VovSp; d20pj: if (!empty($TsW1c)) { $tcA2a = CensorTextProvider::get(modstart_config($s8KxK . '_Text', 'default')); if ($tcA2a) { goto YpwS9; EsoJP: if (Response::isError($oHb9_)) { return false; } goto cVQh9; YpwS9: $oHb9_ = $tcA2a->verify($TsW1c); goto EsoJP; cVQh9: if (!$oHb9_['data']['pass']) { return false; } goto LY1TA; LY1TA: } } goto EXv9i; EXv9i: if (!empty($InnN3)) { $tcA2a = CensorImageProvider::get(modstart_config($s8KxK . '_Image', 'default')); if ($tcA2a) { foreach ($InnN3 as $O7O1_) { goto pDAgO; XBjyV: if (Response::isError($oHb9_)) { return false; } goto cSD5a; pDAgO: $oHb9_ = $tcA2a->verify($O7O1_); goto XBjyV; cSD5a: if (!$oHb9_['data']['pass']) { return false; } goto HCsaa; HCsaa: } } } goto tCigE; lQK9x: list($TsW1c, $InnN3) = $this->parseRichHtml($fKViA); goto d20pj; VovSp: } }