Skip to content

Commit

Permalink
Merge pull request #46 from normal-coder/fix-refresh-parameter-error
Browse files Browse the repository at this point in the history
feat(helper): 支持 ID 选择器
  • Loading branch information
liu21st committed Oct 3, 2019
2 parents 0b4305d + fc39117 commit 1709574
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ function captcha_src($config = null): string
* @param $id
* @return string
*/
function captcha_img($id = ''): string
function captcha_img($id = '', $domid = ''): string
{
$src = captcha_src($id);

$domid = empty($domid) ? $domid : "id='" . $domid . "'";

return "<img src='{$src}' alt='captcha' onclick='this.src=\"{$src}?\"+Math.random();' />";
return "<img src='{$src}' alt='captcha' " . $domid . " onclick='this.src=\"{$src}?\"+Math.random();' />";
}

/**
Expand Down

0 comments on commit 1709574

Please sign in to comment.