function wfCreatePageConfirmEdit(&$captcha, &$editPage, $newtext, $section, $merged, &$result)
{
    global $wgTitle, $wgCreatePageCoverRedLinks;
    // Enable only if the configuration global is set to true,
    // only for Special:CreatePage and only when ConfirmEdit is installed
    $canonspname = SpecialPage::resolveAlias($wgTitle->getDBkey());
    if (!$wgCreatePageCoverRedLinks) {
        return true;
    }
    if ($canonspname != 'CreatePage') {
        return true;
    }
    if (!class_exists('SimpleCaptcha')) {
        return true;
    }
    if ($captcha->shouldCheck($editPage, $newtext, $section, $merged)) {
        if ($captcha->passCaptcha()) {
            $result = true;
            return false;
        } else {
            // display CAP page
            $mainform = new CreatePageCreatePlateForm();
            $mainform->showForm('', false, array(&$captcha, 'editCallback'));
            $editor = new CreatePageMultiEditor($_SESSION['article_createplate']);
            $editor->generateForm($newtext);
            $result = false;
            return false;
        }
    } else {
        return true;
    }
}
 /**
  * Try to submit the form.
  *
  * @return Mixed: boolean false on failure, nothing on success; if
  *                everything went well, the user is redirected to their new
  *                page
  */
 function submitForm()
 {
     global $wgOut, $wgRequest, $wgServer, $wgScript, $wgScriptPath;
     // check if we are editing in red link mode
     if ($wgRequest->getCheck('wpSubmitCreateplate')) {
         $mainform = new CreatePageCreateplateForm();
         $mainform->showForm('');
         $mainform->showCreateplate();
         return false;
     } else {
         $valid = $this->checkArticleExists($wgRequest->getVal('Createtitle'));
         if ($valid != '') {
             // no title? this means overwriting Main Page...
             $mainform = new CreatePageCreateplateForm();
             $mainform->showForm($valid);
             $editor = new CreatePageMultiEditor($this->mCreateplate);
             $editor->generateForm($editor->glueArticle());
             return false;
         }
         if ($wgRequest->getCheck('wpSave')) {
             $editor = new CreatePageMultiEditor($this->mCreateplate);
             $rtitle = Title::newFromText($wgRequest->getVal('Createtitle'));
             $rarticle = new Article($rtitle, $rtitle->getArticleID());
             $editpage = new EditPage($rarticle);
             $editpage->mTitle = $rtitle;
             $editpage->mArticle = $rarticle;
             $editpage->textbox1 = CreateMultiPage::unescapeBlankMarker($editor->glueArticle());
             $editpage->minoredit = $wgRequest->getCheck('wpMinoredit');
             $editpage->watchthis = $wgRequest->getCheck('wpWatchthis');
             $editpage->summary = $wgRequest->getVal('wpSummary');
             $_SESSION['article_createplate'] = $this->mCreateplate;
             // pipe tags to pipes
             wfCreatePageUnescapeKnownMarkupTags($editpage->textbox1);
             $editpage->attemptSave();
             return false;
         } elseif ($wgRequest->getCheck('wpPreview')) {
             $mainform = new CreatePageCreatePlateForm();
             $editor = new CreatePageMultiEditor($this->mCreateplate, true);
             $content = $editor->glueArticle(true, false);
             $content_static = $editor->glueArticle(true);
             $mainform->showForm('', $content_static);
             $editor->generateForm($content);
             return false;
         } elseif ($wgRequest->getCheck('wpAdvancedEdit')) {
             $editor = new CreatePageMultiEditor($this->mCreateplate);
             $content = CreateMultiPage::unescapeBlankMarker($editor->glueArticle());
             wfCreatePageUnescapeKnownMarkupTags($content);
             $_SESSION['article_content'] = $content;
             $wgOut->redirect($wgServer . $wgScript . '?title=' . $wgRequest->getVal('Createtitle') . '&action=edit&createpage=true');
         } elseif ($wgRequest->getCheck('wpImageUpload')) {
             $mainform = new CreatePageCreatePlateForm();
             $mainform->showForm('');
             $editor = new CreatePageMultiEditor($this->mCreateplate);
             $content = $editor->glueArticle();
             $editor->generateForm($content);
         } elseif ($wgRequest->getCheck('wpCancel')) {
             if ($wgRequest->getVal('Createtitle') != '') {
                 $wgOut->redirect($wgServer . $wgScript . '?title=' . $wgRequest->getVal('Createtitle'));
             } else {
                 $wgOut->redirect($wgServer . $wgScript);
             }
         }
     }
 }