r105551 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105550‎ | r105551 | r105552 >
Date:14:22, 8 December 2011
Author:amire80
Status:ok
Tags:
Comment:
Followup to r102105. Removed dir="ltr" from the math expression so as not to force LTR direction, because in some contexts it can be right-to-left, for example with Eastern Arabic digits. Instead, I removed the spaces before and after the operator so that the Unicode algorithm will set the direction automatically.
Modified paths:
  • /trunk/extensions/ConfirmEdit/Captcha.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/Captcha.php
@@ -10,7 +10,9 @@
1111 since the api uses text/plain, not text/html */
1212 $op = mt_rand( 0, 1 ) ? '+' : '−';
1313
14 - $test = "$a $op $b";
 14+ // No space before and after $op, to ensure correct
 15+ // directionality.
 16+ $test = "$a$op$b";
1517 $answer = ( $op == '+' ) ? ( $a + $b ) : ( $a - $b );
1618 return array( 'question' => $test, 'answer' => $answer );
1719 }
@@ -37,9 +39,7 @@
3840 $captcha = $this->getCaptcha();
3941 $index = $this->storeCaptcha( $captcha );
4042
41 - // dir="ltr" is needed because otherwise it may say
42 - // "5 - 20" instead of "20 - 5" and that would be wrong.
43 - return "<p><label dir=\"ltr\" for=\"wpCaptchaWord\">{$captcha['question']}</label> = " .
 43+ return "<p><label for=\"wpCaptchaWord\">{$captcha['question']}</label> = " .
4444 Xml::element( 'input', array(
4545 'name' => 'wpCaptchaWord',
4646 'id' => 'wpCaptchaWord',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102105Adding dir="ltr" to the label, to prevent wrong appearance of the arithmetic ...amire8016:50, 5 November 2011

Status & tagging log