| @@ -19,8 +19,9 @@ | ||
| 19 | 19 | if (!empty($element->params) && !is_string($element->params)) { |
| 20 | 20 | $element->params = json_encode($element->params); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + // The id is a string | |
| 23 | 24 | $scenarioStep = acym_loadObject('SELECT * FROM #__acym_scenario_step WHERE `id` = '.acym_escapeDB($element->id)); |
| 24 | 25 | |
| 25 | 26 | $previousForce = $this->forceInsert; |
| 26 | 27 | $this->forceInsert = empty($scenarioStep); |
| @@ -134,9 +135,9 @@ | ||
| 134 | 135 | $randomString = ''; |
| 135 | 136 | $length = 24; |
| 136 | 137 | |
| 137 | 138 | for ($i = 0; $i < $length; $i++) { |
| 138 | - $randomIndex = rand(0, strlen($letters) - 1); | |
| 139 | + $randomIndex = acym_rand(0, strlen($letters) - 1); | |
| 139 | 140 | $randomString .= $letters[$randomIndex]; |
| 140 | 141 | } |
| 141 | 142 | |
| 142 | 143 | if (in_array($randomString, $allStepIds)) { |