Index: captcha.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v retrieving revision 1.100 diff -u -b -u -p -r1.100 captcha.module --- captcha.module 20 Sep 2009 10:57:07 -0000 1.100 +++ captcha.module 3 Nov 2009 22:47:37 -0000 @@ -401,7 +401,6 @@ function captcha_validate_case_insensiti * captcha_form_alter(), and subsequently don't include additional include * files). */ - function captcha_validate($element, &$form_state) { $captcha_info = $element['#captcha_info']; $form_id = $captcha_info['form_id']; Index: image_captcha/image_captcha.user.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/captcha/image_captcha/image_captcha.user.inc,v retrieving revision 1.21 diff -u -b -u -p -r1.21 image_captcha.user.inc --- image_captcha/image_captcha.user.inc 22 Sep 2009 22:51:00 -0000 1.21 +++ image_captcha/image_captcha.user.inc 3 Nov 2009 22:47:37 -0000 @@ -98,7 +98,9 @@ function _image_captcha_generate_image($ imagefilledrectangle($image, 0, 0, $width, $height, $background_color); // draw text - $result = _image_captcha_image_generator_print_string($image, $width, $height, $font, $font_size, $code); + global $language; + $rtl = (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL); // @todo: the check if LANGUAGE_RTL is defined can be dropped for Drupal 7. + $result = _image_captcha_image_generator_print_string($image, $width, $height, $font, $font_size, $code, $rtl); if (!$result) { return FALSE; } @@ -231,7 +233,7 @@ function _image_captcha_image_generator_ /** * Helper function for drawing text on the image. */ -function _image_captcha_image_generator_print_string(&$image, $width, $height, $font, $font_size, $text) { +function _image_captcha_image_generator_print_string(&$image, $width, $height, $font, $font_size, $text, $rtl=FALSE) { // get characters $characters = _image_captcha_utf8_split($text); $character_quantity = count($characters); @@ -268,6 +270,9 @@ function _image_captcha_image_generator_ foreach ($characters as $c => $character) { // initial position of character: in the center of its cage $center_x = ($c + 0.5) * $ccage_width; + if ($rtl) { + $center_x = $width - $center_x; + } $center_y = 0.5 * $height; // get character dimensions for ttf fonts