Rev 609 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?phpdefine('HASHCASH_FORM_ACTION', 'wp-comments-post.php');define('HASHCASH_SECRET_FILE', realpath(dirname(__FILE__) . '/') . '/wp-hashcash.key');define('HASHCASH_FORM_ID', 'ACEditor');define('HASHCASH_FORM_CLASS', 'page');define('HASHCASH_REFRESH', 60*60*4);define('HASHCASH_IP_EXPIRE', 60*60*24*7);define('HASHCASH_VERSION', 3.2);// Produce random unique stringsfunction hashcash_random_string($l, $exclude = array()) {// Sanity checkif($l < 1){return '';}$str = '';while(in_array($str, $exclude) || strlen($str) < $l){$str = '';while(strlen($str) < $l){$str .= chr(rand(65, 90) + rand(0, 1) * 32);}}return $str;}// looks up the secret keyfunction hashcash_field_value(){if(function_exists('file_get_contents')){return file_get_contents(HASHCASH_SECRET_FILE);} else {$fp = fopen(HASHCASH_SECRET_FILE, 'r');$data = fread($fp, @filesize(HASHCASH_SECRET_FILE));fclose($fp);return $data;}}// Returns a phrase representing the productfunction hashcash_verbage(){$phrase = 'Protection anti-spam active';return $phrase;}?>