Apps/Model/Admin/Content/FormContentUpdate.php 1 location
|
@@ 252-262 (lines=11) @@
|
| 249 |
|
* Generate random string for comment hash value |
| 250 |
|
* @return string |
| 251 |
|
*/ |
| 252 |
|
private function generateCommentHash() |
| 253 |
|
{ |
| 254 |
|
$hash = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 255 |
|
$find = Content::where('comment_hash', '=', $hash)->count(); |
| 256 |
|
// hmmm, is always exist? Chance of it is TOOOO low, but lets recursion re-generate |
| 257 |
|
if ($find !== 0) { |
| 258 |
|
return $this->generateCommentHash(); |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
return $hash; |
| 262 |
|
} |
| 263 |
|
} |
Apps/Model/Front/Content/FormNarrowContentUpdate.php 1 location
|
@@ 228-238 (lines=11) @@
|
| 225 |
|
* Generate random string for comment hash value |
| 226 |
|
* @return string |
| 227 |
|
*/ |
| 228 |
|
private function generateCommentHash() |
| 229 |
|
{ |
| 230 |
|
$hash = Str::randomLatinNumeric(mt_rand(32, 128)); |
| 231 |
|
$find = Content::where('comment_hash', '=', $hash)->count(); |
| 232 |
|
// hmmm, is always exist? Chance of it is TOOOO low, but lets recursion re-generate |
| 233 |
|
if ($find !== 0) { |
| 234 |
|
return $this->generateCommentHash(); |
| 235 |
|
} |
| 236 |
|
|
| 237 |
|
return $hash; |
| 238 |
|
} |
| 239 |
|
} |