Exemplo n.º 1
0
	/**
	* Verifies the akismet key is 0-9a-z
	*
	* @param	string	Page text
	*
	* @param	bool	Whether the text is valid
	*/
	function verify_akismet(&$akismet_key)
	{
		if (!empty($akismet_key))
		{
			if (!preg_match('#^[a-z0-9]+$#i', $akismet_key))
			{
				$this->error('akismet_key_invalid', $akismet_key);
				return false;
			}

			require_once(DIR . '/includes/class_akismet.php');
			$akismet = new vB_Akismet($this->registry);

			$akismet->akismet_key = $akismet_key;
			$akismet->akismet_board = $this->registry->options['bburl'] . '/blog.php';

			if (!$akismet->_build())
			{
				$this->error('akismet_key_invalid', $akismet_key);
				return false;
			}
		}
		return true;
	}