Patch by infinity0x@gmail.com
I just added some spaces and added the FancyCaptcha.php definition.
# the default for edits
return wfEmptyMsg( $name, $text ) ? wfMsg( 'fancycaptcha-edit' ) : $text;
}
+
+ /**
+ * Delete a solved captcha image, if $wgCaptchaDeleteOnSolve is true.
+ */
+ function passCaptcha() {
+ global $wgCaptchaDeleteOnSolve;
+
+ $info = $this->retrieveCaptcha(); // get the captcha info before it gets deleted
+ $pass = parent::passCaptcha();
+
+ if ( $pass && $wgCaptchaDeleteOnSolve ) {
+ $filename = $this->imagePath( $info['salt'], $info['hash'] );
+ if ( file_exists( $filename ) ) {
+ unlink( $filename );
+ }
+ }
+
+ return $pass;
+ }
}
global $wgCaptchaSecret;
$wgCaptchaSecret = "CHANGE_THIS_SECRET!";
+/**
+ * By default the FancyCaptcha rotates among all available captchas.
+ * Setting $wgCaptchaDeleteOnSolve to true will delete the captcha
+ * files when they are correctly solved. Thus the user will need
+ * something like a cron creating new thumbnails to avoid drying up.
+ */
+$wgCaptchaDeleteOnSolve = false;
+
$wgExtensionMessagesFiles['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.i18n.php';
$wgAutoloadClasses['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.class.php';