Page MenuHomePhabricator

hyphen-minus is unreadable
Closed, ResolvedPublic

Description

Author: giecrilj

Description:
It is hard to tell hyphen-minus from multiplication dot.
I would recommend using − instead for presentation.

function SimpleCaptcha.getCaptcha() {
    $a = mt_rand(0, 100);
    $b = mt_rand(0, 10);
    $op = mt_rand(0, 1) ? '+' : '−';

    $test = "$a $op $b";
    $answer = ($op == '+') ? ($a + $b) : ($a - $b);
    return array('question' => $test, 'answer' => $answer);
}

Alternatively, the equation should be typeset in a monospaced font style.


Version: unspecified
Severity: enhancement
URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ConfirmEdit/ConfirmEdit_body.php?view=markup

Details

Reference
bz16213

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:20 PM
bzimport set Reference to bz16213.
bzimport added a subscriber: Unknown Object (MLST).

krixel wrote:

I do not have a development environment for MediaWiki (in particular, I do not have Subversion). I hope replacing that '-' with '−' is simple enough for any developer.
Do not take it as a refusal. I just doubt I will be able to set things up quickly.

krixel wrote:

76c76

< $op = mt_rand(0, 1) ? '+' : '-';

$op = mt_rand(0, 1) ? '+' : '&minus;';

(Untested.)

krixel wrote:

Index: extensions/ConfirmEdit/ConfirmEdit_body.php

  • extensions/ConfirmEdit/ConfirmEdit_body.php (revision 47356)

+++ extensions/ConfirmEdit/ConfirmEdit_body.php (working copy)
@@ -73,7 +73,7 @@

function getCaptcha() {
        $a = mt_rand(0, 100);
        $b = mt_rand(0, 10);
  • $op = mt_rand(0, 1) ? '+' : '-';

+ $op = mt_rand(0, 1) ? '+' : '&minus;';

$test = "$a $op $b";
$answer = ($op == '+') ? ($a + $b) : ($a - $b);

(This is subversion diff this time, still struggling with how to test it)

krixel wrote:

Test done, result positive.