当前位置: 首页>>代码示例>>PHP>>正文


PHP EditPage::spamPage方法代码示例

本文整理汇总了PHP中EditPage::spamPage方法的典型用法代码示例。如果您正苦于以下问题:PHP EditPage::spamPage方法的具体用法?PHP EditPage::spamPage怎么用?PHP EditPage::spamPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EditPage的用法示例。


在下文中一共展示了EditPage::spamPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: filter

 function filter(&$title, $text, $section)
 {
     global $wgArticle, $wgVersion, $wgOut, $wgParser, $wgUser;
     $fname = 'wfSpamBlacklistFilter';
     wfProfileIn($fname);
     # Call the rest of the hook chain first
     if ($this->previousFilter) {
         $f = $this->previousFilter;
         if ($f($title, $text, $section)) {
             wfProfileOut($fname);
             return true;
         }
     }
     $this->title = $title;
     $this->text = $text;
     $this->section = $section;
     $regexes = $this->getRegexes();
     $whitelists = $this->getWhitelists();
     if (is_array($regexes)) {
         # Run parser to strip SGML comments and such out of the markup
         # This was being used to circumvent the filter (see bug 5185)
         $options = new ParserOptions();
         $text = $wgParser->preSaveTransform($text, $title, $wgUser, $options);
         $out = $wgParser->parse($text, $title, $options);
         $links = implode("\n", array_keys($out->getExternalLinks()));
         # Strip whitelisted URLs from the match
         if (is_array($whitelists)) {
             wfDebug("Excluding whitelisted URLs from " . count($whitelists) . " regexes: " . implode(', ', $whitelists) . "\n");
             foreach ($whitelists as $regex) {
                 $links = preg_replace($regex, '', $links);
             }
         }
         # Do the match
         wfDebug("Checking text against " . count($regexes) . " regexes: " . implode(', ', $regexes) . "\n");
         $retVal = false;
         foreach ($regexes as $regex) {
             if (preg_match($regex, $links, $matches)) {
                 wfDebug("Match!\n");
                 EditPage::spamPage($matches[0]);
                 $retVal = true;
                 break;
             }
         }
     } else {
         $retVal = false;
     }
     wfProfileOut($fname);
     return $retVal;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:49,代码来源:SpamBlacklist_body.php

示例2: filter

 function filter(&$title, $text, $section)
 {
     global $wgArticle, $wgVersion, $wgOut;
     $fname = 'wfSpamBlacklistFilter';
     wfProfileIn($fname);
     # Call the rest of the hook chain first
     if ($this->previousFilter) {
         $f = $this->previousFilter;
         if ($f($title, $text, $section)) {
             wfProfileOut($fname);
             return true;
         }
     }
     $this->title = $title;
     $this->text = $text;
     $this->section = $section;
     $regex =& $this->getRegex();
     if ($regex && $regex[0] == '/') {
         # Do the match
         wfDebug("Checking text against regex: {$regex}\n");
         if (preg_match($regex, $text, $matches)) {
             wfDebug("Match!\n");
             EditPage::spamPage($matches[0]);
             $retVal = true;
         } else {
             $retVal = false;
         }
     } else {
         $retVal = false;
     }
     wfProfileOut($fname);
     return $retVal;
 }
开发者ID:BackupTheBerlios,项目名称:spamfilter-svn,代码行数:33,代码来源:SpamBlacklistAlt_body.php


注:本文中的EditPage::spamPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。