You are here

function spam_sanitize_score in Spam 6

Same name and namespace in other branches
  1. 5.3 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()
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.
spam_filter_bayesian_tokens_update in filters/spam_filter_bayesian/spam_filter_bayesian.module
Update token probabilities in database.

File

./spam.module, line 1570
Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.

Code

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