r75667 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75666‎ | r75667 | r75668 >
Date:19:31, 29 October 2010
Author:hartman
Status:ok
Tags:
Comment:
Use a minus sign in the simplecaptcha question, instead of a hyphen. Fixes bug 16213.

Per suggestion of Christopher Yeleighton, adapted by Derk-Jan Hartman.
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php
@@ -76,8 +76,11 @@
7777 function getCaptcha() {
7878 $a = mt_rand( 0, 100 );
7979 $b = mt_rand( 0, 10 );
80 - $op = mt_rand( 0, 1 ) ? '+' : '-';
8180
 81+ /* Minus sign is used in the question. UTF-8,
 82+ since the api uses text/plain, not text/html */
 83+ $op = mt_rand( 0, 1 ) ? '+' : '−';
 84+
8285 $test = "$a $op $b";
8386 $answer = ( $op == '+' ) ? ( $a + $b ) : ( $a - $b );
8487 return array( 'question' => $test, 'answer' => $answer );

Status & tagging log