ToastFreeware
/
toast
/
cookiecaptcha.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding elements to $wgSpecialPages must be done before SpecialPage::initList()
[toast/cookiecaptcha.git]
/
FancyCaptcha.php
diff --git
a/FancyCaptcha.php
b/FancyCaptcha.php
index e6363281d1acb251226fa5490d6a21fb24ca856f..c21afb8c854775c82add2f4b2f6b60467e145501 100644
(file)
--- a/
FancyCaptcha.php
+++ b/
FancyCaptcha.php
@@
-51,7
+51,7
@@
class FancyCaptcha extends SimpleCaptcha {
$answerHash = substr( md5( $digest ), 0, 16 );
if( $answerHash == $info['hash'] ) {
$answerHash = substr( md5( $digest ), 0, 16 );
if( $answerHash == $info['hash'] ) {
- wfDebug( "FancyCaptcha: answer hash matches expected
$hash
\n" );
+ wfDebug( "FancyCaptcha: answer hash matches expected
{$info['hash']}
\n" );
return true;
} else {
wfDebug( "FancyCaptcha: answer hashes to $answerHash, expected {$info['hash']}\n" );
return true;
} else {
wfDebug( "FancyCaptcha: answer hashes to $answerHash, expected {$info['hash']}\n" );
@@
-62,7
+62,7
@@
class FancyCaptcha extends SimpleCaptcha {
/**
* Insert the captcha prompt into the edit form.
*/
/**
* Insert the captcha prompt into the edit form.
*/
- function
formCallback( &$out
) {
+ function
getForm(
) {
$info = $this->pickImage();
if( !$info ) {
die( "out of captcha images; this shouldn't happen" );
$info = $this->pickImage();
if( !$info ) {
die( "out of captcha images; this shouldn't happen" );
@@
-77,9
+77,7
@@
class FancyCaptcha extends SimpleCaptcha {
$title = Title::makeTitle( NS_SPECIAL, 'Captcha/image' );
$title = Title::makeTitle( NS_SPECIAL, 'Captcha/image' );
- $out->addWikiText( wfMsg( "captcha-short" ) );
-
- $out->addHTML( "<p>" .
+ return "<p>" .
wfElement( 'img', array(
'src' => $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ),
'width' => $info['width'],
wfElement( 'img', array(
'src' => $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ),
'width' => $info['width'],
@@
-96,7
+94,7
@@
class FancyCaptcha extends SimpleCaptcha {
'name' => 'wpCaptchaWord',
'id' => 'wpCaptchaWord',
'tabindex' => 1 ) ) . // tab in before the edit textarea
'name' => 'wpCaptchaWord',
'id' => 'wpCaptchaWord',
'tabindex' => 1 ) ) . // tab in before the edit textarea
- "</p>\n"
)
;
+ "</p>\n";
}
/**
}
/**
@@
-163,7
+161,7
@@
class FancyCaptcha extends SimpleCaptcha {
}
$info['viewed'] = wfTimestamp();
}
$info['viewed'] = wfTimestamp();
- $this->storeCaptcha( $info
, $info['index']
);
+ $this->storeCaptcha( $info );
$salt = $info['salt'];
$hash = $info['hash'];
$salt = $info['salt'];
$hash = $info['hash'];