pickImage(); if ( !$info ) { $resultArr['captcha']['error'] = 'Out of images'; return; } $index = $this->storeCaptcha( $info ); $title = SpecialPage::getTitleFor( 'Captcha', 'image' ); $resultArr['captcha']['type'] = 'image'; $resultArr['captcha']['mime'] = 'image/png'; $resultArr['captcha']['id'] = $index; $resultArr['captcha']['url'] = $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ); } */ /** * Insert the captcha prompt into the edit form. */ /* function getForm() { $info = $this->pickImage(); if ( !$info ) { throw new MWException( "Ran out of captcha images" ); } // Generate a random key for use of this captcha image in this session. // This is needed so multiple edits in separate tabs or windows can // go through without extra pain. $index = $this->storeCaptcha( $info ); wfDebug( "Captcha id $index using hash ${info['hash']}, salt ${info['salt']}.\n" ); $title = SpecialPage::getTitleFor( 'Captcha', 'image' ); return "

" . Html::element( 'img', array( 'src' => $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ), 'width' => $info['width'], 'height' => $info['height'], 'alt' => '' ) ) . "

\n" . Html::element( 'input', array( 'type' => 'hidden', 'name' => 'wpCaptchaId', 'id' => 'wpCaptchaId', 'value' => $index ) ) . '

' . Html::element( 'label', array( 'for' => 'wpCaptchaWord', ), parent::getMessage( 'label' ) . wfMessage( 'colon-separator' )->text() ) . Html::element( 'input', array( 'name' => 'wpCaptchaWord', 'id' => 'wpCaptchaWord', 'type' => 'text', 'autocorrect' => 'off', 'autocapitalize' => 'off', 'required' => 'required', 'tabindex' => 1 ) ) . // tab in before the edit textarea "

\n"; } */ /** * Show a message asking the user to enter a captcha on edit * The result will be treated as wiki text * * @param $action string Action being performed * @return string */ /* function getMessage( $action ) { $name = 'fancycaptcha-' . $action; $text = wfMessage( $name )->text(); # Obtain a more tailored message, if possible, otherwise, fall back to # the default for edits return wfMessage( $name, $text )->isDisabled() ? wfMessage( 'fancycaptcha-edit' )->text() : $text; } */ }