Skip to content

Commit

Permalink
fixed #7929: On windows no more than 32768 tokens can be generated
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Jun 17, 2013
1 parent b55deac commit 0d32378
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions application/helpers/common_helper.php
Expand Up @@ -5302,12 +5302,10 @@ function hasResources($id,$type='survey')
function randomChars($length,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
{
$patternlength = strlen($pattern)-1;
$key = '';
for($i=0;$i<$length;$i++)
{
if(isset($key))
$key .= $pattern{rand(0,$patternlength)};
else
$key = $pattern{rand(0,$patternlength)};
$key .= $pattern{mt_rand(0,$patternlength)};
}
return $key;
}
Expand Down

0 comments on commit 0d32378

Please sign in to comment.