Skip to content

Commit

Permalink
Fixed issue: captcha box no numbers in box
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Aug 17, 2018
1 parent 3c7655f commit 197b409
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions application/controllers/VerificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function actionImage($sid)
$rootdir = Yii::app()->getConfig('rootdir');

// header for png
Header("Content-Type: image/png");
//Header("Content-Type: image/png");

// Create Image
$im = ImageCreate(75, 20);
Expand Down Expand Up @@ -60,11 +60,13 @@ function actionImage($sid)
$font_color = $blue;
}

$font_rand = rand(1, 2); //Maybe add other specific hard font
if ($font_rand == 1) {
$font = $rootdir."/assets/fonts/FreeSans.ttf";
} else {
$font = $rootdir."/assets/fonts/DejaVuSans.ttf";
$font_rand = rand(1,5); //Maybe add other specific hard font
switch ($font_rand) {
case 1: $font = $rootdir."/assets/fonts/font-src/FreeSans.ttf"; break;
case 2: $font = $rootdir."/assets/fonts/DejaVuSans.ttf"; break;
case 3: $font = $rootdir."/assets/fonts/font-src/lato-v11-latin-700.ttf"; break;
case 4: $font = $rootdir."/assets/fonts/font-src/news-cycle-v13-latin-regular.ttf"; break;
case 5: $font = $rootdir."/assets/fonts/font-src/ubuntu-v9-latin-regular.ttf"; break;
}

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

0 comments on commit 197b409

Please sign in to comment.