Followup to r102105. Removed dir="ltr" from the math expression so as not to force...
authorAmir E. Aharoni <amire80@users.mediawiki.org>
Thu, 8 Dec 2011 14:22:41 +0000 (14:22 +0000)
committerAmir E. Aharoni <amire80@users.mediawiki.org>
Thu, 8 Dec 2011 14:22:41 +0000 (14:22 +0000)
Captcha.php

index a3c6ee5089d9a3ffc7072507fc59daea58af08d5..386b6bdb38d85703f86603cb3478717f390d165d 100644 (file)
@@ -10,7 +10,9 @@ class SimpleCaptcha {
                   since the api uses text/plain, not text/html */
                $op = mt_rand( 0, 1 ) ? '+' : '−';
 
-               $test = "$a $op $b";
+               // No space before and after $op, to ensure correct
+               // directionality.
+               $test = "$a$op$b";
                $answer = ( $op == '+' ) ? ( $a + $b ) : ( $a - $b );
                return array( 'question' => $test, 'answer' => $answer );
        }
@@ -37,9 +39,7 @@ class SimpleCaptcha {
                $captcha = $this->getCaptcha();
                $index = $this->storeCaptcha( $captcha );
 
-               // dir="ltr" is needed because otherwise it may say
-               // "5 - 20" instead of "20 - 5" and that would be wrong.
-               return "<p><label dir=\"ltr\" for=\"wpCaptchaWord\">{$captcha['question']}</label> = " .
+               return "<p><label for=\"wpCaptchaWord\">{$captcha['question']}</label> = " .
                        Xml::element( 'input', array(
                                'name' => 'wpCaptchaWord',
                                'id'   => 'wpCaptchaWord',