function _spam_sign in Spam 5.3
Same name and namespace in other branches
- 6 spam.module \_spam_sign()
Helper function, returns a randomized token used to build a unique path for reporting mis-filtered content. Intended as a spam deterrent.
4 calls to _spam_sign()
- spam_admin_feedback_form_submit in ./
spam.module - Process spam feedback.
- spam_menu in ./
spam.module - Drupal _menu() hook.
- spam_scan in ./
spam.module - API call for scanning content for spam. If spam is found, the appropriate action will be taken.
- _spam_error_link in ./
spam.module - Helper function, generate a link for reporting mis-filtered content.
File
- ./
spam.module, line 1519
Code
function _spam_sign($text) {
if (!variable_get('spam_sign_start', '')) {
variable_set('spam_sign_start', rand(0, 22));
variable_set('spam_sign_end', rand(45, 115));
}
if (!variable_get('spam_sign_key', '')) {
variable_set('spam_sign_key', md5(microtime()));
}
// TODO: Be sure signing is changing...
return md5(substr($text, variable_get('spam_sign_start', 0), variable_get('spam_sign_end', 11)) . variable_get('spam_sign_key', ''));
}