修正了模版拼接错误的BUG,应该将element变量拼接到img标签的id属性,而不是alt属性

This commit is contained in:
changwei
2018-06-07 18:31:46 +08:00
parent 951cdb0a39
commit 246728b345

View File

@@ -57,8 +57,8 @@ function captcha_img($id = '')
*/ */
function captcha_img_with_replacement($id = '', $element = 'think-captcha') function captcha_img_with_replacement($id = '', $element = 'think-captcha')
{ {
return '<img src="' . captcha_src($id) . '" alt="captcha" id="' . $element . '" onclick="document.getElementById("' . $element . '").src="' . return '<img src="' . captcha_src($id) . '" alt="captcha" id="' . $element . '" onclick="document.getElementById("'
captcha_src($id) . '"+Math.random()' . '/>'; . $element . '").src="' . captcha_src($id) . '"+Math.random()' . '/>';
} }