+
+ /**
+ * 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;
+ }