Пример #1
0
 public static function checkTitle($title)
 {
     wfProfileIn(__METHOD__);
     if (is_null(self::$blocksData)) {
         self::$blocksData = Phalanx::getFromFilter(Phalanx::TYPE_TITLE);
     }
     $fullText = $title->getFullText();
     $result = array('blocked' => false);
     if (!empty(self::$blocksData)) {
         $blockData = null;
         $result = Phalanx::findBlocked($fullText, self::$blocksData, true, $blockData);
         if ($result['blocked']) {
             self::spamPage($result['msg'], $title);
             Wikia::log(__METHOD__, __LINE__, "Block '{$result['msg']}' blocked '{$fullText}'.");
         }
     }
     wfProfileOut(__METHOD__);
     return !$result['blocked'];
 }
Пример #2
0
 /**
  * @author Federico "Lox" Lucignano
  *
  * Factory method
  *
  * @param Title $title a Title class instance for the article
  * @param boolean $skipPhalanxCheck a flag informs to check Phalanx or not
  *
  * @return TopList|bool|mixed a TopList instance, false in case $title is not in the NS_TOPLIST namespace
  */
 public static function newFromTitle(Title $title, $skipPhalanxCheck = false)
 {
     global $wgMemc;
     //FB#16388: we don't need to check Phalanx blocks while deleting
     if (!$skipPhalanxCheck) {
         //FB#8083: blocked titles are not being filtered, this should be handled automatically by Phalanx though...
         $notPhalanxBlocked = TitleBlock::checkTitle($title);
     } else {
         $notPhalanxBlocked = true;
     }
     if ($title->getNamespace() == NS_TOPLIST && !$title->isSubpage() && $notPhalanxBlocked) {
         $list = new self();
         $list->mTitle = $title;
         //needed to let getItems fetch fresh data when instantiating more tha once with the same title object
         $wgMemc->set($list->_getNeedRefreshCacheKey(), true);
         return $list;
     }
     return false;
 }
Пример #3
0
 public function match_title_old()
 {
     /* problem with Phalanx service? - use previous version of Phalanx extension - tested */
     return TitleBlock::genericTitleCheck($this->title, $this->block);
 }