diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-08 14:44:33 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-08 14:44:33 +1100 |
| commit | 74f5964471472583980303e562d9ec137aacb31b (patch) | |
| tree | 1389175687c42fa1189437dd98a0b23e5857ebd0 | |
| parent | 6a02dfd5aa63f1a003ace12126d9439bf784528c (diff) | |
use raw SHA1 to calculate anti-spam inputs
| -rw-r--r-- | inc/functions.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php index 7dcdc088..c469a6c7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1061,7 +1061,8 @@ for($x=0;$x<$input_count;$x++) { if(rand(0, 2) == 0 || $hidden_input_names_x < 0) { // Use an obscure name - $name = substr(base64_encode(sha1(rand())), 0, rand(2, 40)); + $name = strtolower(substr(base64_encode(sha1(rand(), true)), 0, rand(2, 20))); + } else { // Use a pre-defined confusing name $name = $config['spam']['hidden_input_names'][$hidden_input_names_x++]; @@ -1077,7 +1078,7 @@ $inputs[$name] = rand(0, 100); } else { // Obscure value - $inputs[$name] = substr(base64_encode(sha1(rand())), 0, rand(2, 40)); + $inputs[$name] = substr(base64_encode(sha1(rand(), true) . sha1(rand(), true)), 0, rand(2, 54)); } } |
