You are here

function spam_sanitize_score in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_sanitize_score()

Be sure the spam score is within the allowable range of 1 and 99.

2 calls to spam_sanitize_score()
bayesian_tokens_update in filters/bayesian/bayesian.module
Update token probabilities in database.
spam_content_filter in ./spam.module
API call to determine the likeliness that a given piece of content is spam, returning a rating from 1% likelihood to 99% likelihood. It is unlikely that you want to call this function directly.

File

./spam.module, line 1505

Code

function spam_sanitize_score($score) {
  if ((int) $score < 1) {
    return 1;
  }
  else {
    if ((int) $score > 99) {
      return 99;
    }
  }
  return round($score, 0);
}