Skip to content

Commit

Permalink
Fixed issue #06863: Captcha not working
Browse files Browse the repository at this point in the history
Dev: replace font for Captcha
Dev: maybe have to replace by better system (with accessibility) http://www.w3.org/TR/turingtest/#security
  • Loading branch information
Shnoulle committed Nov 14, 2012
1 parent b09b216 commit a118d04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/config/config-defaults.php
Expand Up @@ -351,7 +351,7 @@

/**
* $chartfontfile - set the font file name used to created the charts in statistics - this font must reside in <limesurvey root folder>/fonts
* Set this to specific font-file (for example 'vera.ttf') or set it to 'auto' and LimeSurvey tried to pick the best font depending on your survey base language
* Set this to specific font-file (for example 'DejaVuSans.ttf') or set it to 'auto' and LimeSurvey tried to pick the best font depending on your survey base language
*/
$config['chartfontfile']='auto';
/**
Expand Down
11 changes: 4 additions & 7 deletions application/controllers/VerificationController.php
Expand Up @@ -64,15 +64,12 @@ function actionImage($sid)
$font_color = $blue;
}

$font_rand = rand(1,3);
$font_rand = rand(1,2);//Maybe add other specific hard font
if ($font_rand == 1)
{
$font = $rootdir.DIRECTORY_SEPARATOR."fonts".DIRECTORY_SEPARATOR."verabd.ttf";
} else if ($font_rand == 2) {
$font = $rootdir.DIRECTORY_SEPARATOR."fonts".DIRECTORY_SEPARATOR."vera.ttf";
} else if ($font_rand == 3)
{
$font = $rootdir.DIRECTORY_SEPARATOR."fonts".DIRECTORY_SEPARATOR."verait.ttf";
$font = $rootdir."/fonts/FreeSans.ttf";
} else {
$font = $rootdir."/fonts/DejaVuSans.ttf";
}

$line_rand = rand(1,3);
Expand Down

0 comments on commit a118d04

Please sign in to comment.