Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-2324

Captcha charset problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • 3.0.x
    • Other
    • None
    • PHP Environment:
      Database:

      Captcha seems not to work here. I get a broken image. When I call the image URL directly I get:

      [phpBB Debug] PHP Notice: in file /includes/captcha/captcha_gd.php on line 82: imagettftext() [function.imagettftext]: any2eucjp(): invalid code in input string
      [phpBB Debug] PHP Notice: in file /includes/captcha/captcha_gd.php on line 82: imagettftext() [function.imagettftext]: any2eucjp(): invalid code in input string
      [phpBB Debug] PHP Notice: in file /includes/captcha/captcha_gd.php on line 82: imagettftext() [function.imagettftext]: any2eucjp(): invalid code in input string
      [phpBB Debug] PHP Notice: in file /includes/captcha/captcha_gd.php on line 121: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2946)
      [phpBB Debug] PHP Notice: in file /includes/captcha/captcha_gd.php on line 122: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2946)

      This seems to be charset-related. If I do following change to narrow down the created characters, the captcha starts to work.

      --- captcha_gd.php      2006-11-28 07:55:33.000000000 +0100
      +++ captcha_gd.php.w    2006-11-17 20:12:53.000000000 +0100
      @@ -78,7 +78,7 @@
                                      $x              = mt_rand(0, 360);
                                      $y              = mt_rand(0, (int)($this->height - ($size / 5)));
                                      $color  = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224));
      -                               $text   = chr(mt_rand(45, 250));
      +                               $text   = chr(mt_rand(45, 127));
                                      imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text);
                              }
                      }

            DavidMJ DavidMJ
            umbra obscura umbra obscura
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: