<?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($w6bW5) { return false; } public abstract function verifyCount(); public abstract function verifyRule(); public function useFormVerify() { return false; } public function buildForm(Form $NX6uw, $w6bW5) { return null; } public function verifyUrl() { return action($this->verifyRule()); } public function verifyAutoProcessedNotify() { return true; } public function run($w6bW5, $H_jRb = null, $qhTwW = null) { goto B5UU9; B5UU9: if (null === $qhTwW) { $qhTwW = array('内容' => $H_jRb); $P2t8Q = Str::substr(HtmlUtil::text2html($H_jRb), 0, 100); } else { $P2t8Q = $H_jRb; } goto K4v7o; ecocE: $P2t8Q = $this->title() . ($P2t8Q ? '(' . $P2t8Q . ')' : ''); goto Js8i2; K4v7o: $P2t8Q = HtmlUtil::text($P2t8Q); goto ecocE; P4Jzv: NotifierProvider::notifyNoneLoginOperateProcessUrl($this->name(), '[审核]' . $P2t8Q, $qhTwW, $this->useFormVerify() ? 'content_verify/' . $this->name() : null, $w6bW5); goto vL1hp; Js8i2: if ($this->verifyAutoProcess($w6bW5)) { if ($this->verifyAutoProcessedNotify()) { NotifierProvider::notify($this->name(), '[自动审核]' . $P2t8Q, $qhTwW, $w6bW5); } return; } goto P4Jzv; vL1hp: } protected function parseRichHtml($ybjC4) { goto CHIUT; HGGDy: $JfgpO = $rhLXE['text']; goto SmiA6; nN9oM: return array($JfgpO, $ZAK__); goto E0CyY; N5Xqo: $ZAK__ = array(); goto HGGDy; CHIUT: $rhLXE = HtmlUtil::extractTextAndImages($ybjC4); goto N5Xqo; SmiA6: foreach ($rhLXE['images'] as $ICUxJ) { $ZAK__[] = AssetsUtil::fixFull($ICUxJ); } goto nN9oM; E0CyY: } protected function censorRichHtmlSuccess($NMfy6, $ybjC4) { goto ntV4G; xQWUJ: if (!empty($JfgpO)) { $tDnAb = CensorTextProvider::get(modstart_config($NMfy6 . '_Text', 'default')); if ($tDnAb) { goto jMkwK; jMkwK: $rhLXE = $tDnAb->verify($JfgpO); goto UkZIb; bRiAT: if (!$rhLXE['data']['pass']) { return false; } goto iOome; UkZIb: if (Response::isError($rhLXE)) { return false; } goto bRiAT; iOome: } } goto ew31c; ew31c: if (!empty($ZAK__)) { $tDnAb = CensorImageProvider::get(modstart_config($NMfy6 . '_Image', 'default')); if ($tDnAb) { foreach ($ZAK__ as $ICUxJ) { goto pGpnE; frH9M: if (Response::isError($rhLXE)) { return false; } goto gdqEA; pGpnE: $rhLXE = $tDnAb->verify($ICUxJ); goto frH9M; gdqEA: if (!$rhLXE['data']['pass']) { return false; } goto D6PnQ; D6PnQ: } } } goto NwniL; NwniL: return true; goto NmIwi; ntV4G: list($JfgpO, $ZAK__) = $this->parseRichHtml($ybjC4); goto xQWUJ; NmIwi: } }