From afc5cc4cdec9cbab6f233abf0f602d400d3ec538 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 20 Dec 2008 02:12:36 +0000 Subject: [PATCH] bug 16611 -- broken regex made the MathCaptcha image not appear Also, wrong parameter name for the answer made it not work. :) --- MathCaptcha.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MathCaptcha.class.php b/MathCaptcha.class.php index 66567e0..884a4b3 100644 --- a/MathCaptcha.class.php +++ b/MathCaptcha.class.php @@ -22,7 +22,7 @@ class MathCaptcha extends SimpleCaptcha { $index = $this->storeCaptcha( array( 'answer' => $answer ) ); $form = ''; - $form .= '
' . $this->fetchMath( $sum ) . '' . wfInput( 'wpCaptchaAnswer', false, false, array( 'tabindex' => '1' ) ) . '
'; + $form .= '' . wfInput( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . ''; $form .= wfHidden( 'wpCaptchaId', $index ); return $form; } @@ -42,7 +42,7 @@ class MathCaptcha extends SimpleCaptcha { $math = new MathRenderer( $sum ); $math->setOutputMode( MW_MATH_PNG ); $html = $math->render(); - return preg_replace( '/alt=".*"/', '', $html ); + return preg_replace( '/alt=".*?"/', '', $html ); } } -- 2.30.2