diff options
-rw-r--r-- | system/helpers/captcha_helper.php | 8 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 | ||||
-rw-r--r-- | user_guide_src/source/helpers/captcha_helper.rst | 9 |
3 files changed, 10 insertions, 8 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index ea46f97b3..24cd53568 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -215,12 +215,12 @@ if ( ! function_exists('create_captcha')) // ----------------------------------- // Generate the image // ----------------------------------- - $img_name = $now.'.jpg'; - ImageJPEG($im, $img_path.$img_name); - $img = '<img src="'.$img_url.$img_name.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />'; + $img_filename = $now.'.jpg'; + ImageJPEG($im, $img_path.$img_filename); + $img = '<img src="'.$img_url.$img_filename.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />'; ImageDestroy($im); - return array('word' => $word, 'time' => $now, 'image' => $img); + return array('word' => $word, 'time' => $now, 'image' => $img, 'filename' => $img_filename); } } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8f5dfe540..053f57703 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -128,6 +128,7 @@ Release Date: Not Released - Added *word_length* and *pool* options to allow customization of the generated word. - Added *colors* configuration to allow customization for the *background*, *border*, *text* and *grid* colors. + - Added *filename* to the returned array elements. - :doc:`Directory Helper <helpers/directory_helper>` :php:func:`directory_map()` will now append ``DIRECTORY_SEPARATOR`` to directory names in the returned array. - :doc:`Array Helper <helpers/array_helper>` :php:func:`element()` and :php:func:`elements()` now return NULL instead of FALSE when the required elements don't exist. diff --git a/user_guide_src/source/helpers/captcha_helper.rst b/user_guide_src/source/helpers/captcha_helper.rst index 3c56addf3..f47173453 100644 --- a/user_guide_src/source/helpers/captcha_helper.rst +++ b/user_guide_src/source/helpers/captcha_helper.rst @@ -26,7 +26,7 @@ create_captcha() :param string $img_path: Path to create the image in :param string $img_url: URL to the CAPTCHA image folder :param string $font_path: Server path to font - :returns: array('word' => $word, 'time' => $now, 'image' => $img) + :returns: array Takes an array of information to generate the CAPTCHA as input and creates the image to your specifications, returning an array of @@ -35,9 +35,10 @@ associative data about the image. :: array( - 'image' => IMAGE TAG - 'time' => TIMESTAMP (in microtime) - 'word' => CAPTCHA WORD + 'word' => CAPTCHA WORD, + 'time' => TIMESTAMP (in microtime), + 'image' => IMAGE TAG, + 'filename' => IMAGE FILE NAME ) The **image** is the actual image tag:: |