Exemple #1
0
 function doSubmit()
 {
     wfProfileIn(__METHOD__);
     global $wgOut, $wgUser, $wgMemc;
     global $wgExternalDatawareDB;
     /* empty name */
     if (strlen($this->mBlockedRegex) == 0) {
         $this->showForm(wfMsgHtml('textregex-empty-regex'));
         wfProfileOut(__METHOD__);
         return;
     }
     /* validate expression */
     if (!($simple_regex = TextRegexList::validateRegex($this->mBlockedRegex))) {
         $this->showForm(wfMsgHtml('textregex-invalid-regex'));
         wfProfileOut(__METHOD__);
         return;
     }
     $oRegexCore = new TextRegexCore($this->subPage, 0);
     $res = $oRegexCore->addPhrase($this->mBlockedRegex);
     /* duplicate entry */
     if ($res === false) {
         $this->showForm(wfMsgHtml('textregex-already-added', $this->mBlockedRegex));
         wfProfileOut(__METHOD__);
         return;
     }
     /* redirect */
     wfProfileOut(__METHOD__);
     $wgOut->redirect($this->oTitle->getFullURL('action=success_block&text=' . $this->mBlockedRegex . '&' . $this->oTRList->getListBits()));
 }