Skip to content

Commit

Permalink
Dev: uneeded typecast, but scrutinizer is not happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jun 14, 2019
1 parent 676619f commit e2a9ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/Survey.php
Expand Up @@ -936,7 +936,7 @@ public function insertNewSurvey($aData)
unset($aData['wishSID']);
}
if(empty($aData['sid'])) {
$aData['sid'] = randomChars(6, '123456789');
$aData['sid'] = intval(randomChars(6, '123456789'));
}
$survey = new self;
foreach ($aData as $k => $v) {
Expand All @@ -947,7 +947,7 @@ public function insertNewSurvey($aData)
/* Validate sid : > 1 and unique */
while(!$survey->validate(array('sid'))) {
$attempts++;
$survey->sid = randomChars(6, '123456789');
$survey->sid = intval(randomChars(6, '123456789'));
/* If it's happen : there are an issue in server … (or in randomChars function …) */
if($attempts > 50) {
throw new Exception("Unable to get a valid survey id after 50 attempts");
Expand Down

0 comments on commit e2a9ca1

Please sign in to comment.