<commit_before><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

//this script may only be included - so its better to die if called directly.
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));

if ( isset($_REQUEST['pollVote']) && !empty($_REQUEST['polls_pollId']) ) {
	$ok = true;
	if (empty($_REQUEST['polls_optionId'])) {
		$ok = false;
		$smarty->assign('msg_poll', tra('You must choose an option'));
	} elseif ( $tiki_p_vote_poll == 'y' && ($prefs['feature_poll_anonymous'] == 'y' || $user || $prefs['feature_antibot'] == 'y')) {
		if (empty($user) && empty($_COOKIE)) {
			$ok = false;
			$smarty->assign('msg_poll', tra('For you to vote, cookies must be allowed'));
			$smarty->assign_by_ref('polls_optionId', $_REQUEST['polls_optionId']);
		} elseif (($prefs['feature_antibot'] == 'y' && empty($user)) && (!$captchalib->validate())) {
			$ok = false;
			$smarty->assign('msg_poll', $captchalib->getErrors());
			$smarty->assign_by_ref('polls_optionId', $_REQUEST['polls_optionId']);
		} else {
			global $polllib; include_once('lib/polls/polllib_shared.php');
			$poll = $polllib->get_poll($_REQUEST['polls_pollId']);
			if( empty($poll) || $poll['active'] == 'x' ) {
				$ok = false;<commit_msg>missing global<commit_after><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

//this script may only be included - so its better to die if called directly.
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));

if ( isset($_REQUEST['pollVote']) && !empty($_REQUEST['polls_pollId']) ) {
	$ok = true;
	if (empty($_REQUEST['polls_optionId'])) {
		$ok = false;
		$smarty->assign('msg_poll', tra('You must choose an option'));
	} elseif ( $tiki_p_vote_poll == 'y' && ($prefs['feature_poll_anonymous'] == 'y' || $user || $prefs['feature_antibot'] == 'y')) {
		global $captchalib; require_once('lib/captcha/captchalib.php');
		if (empty($user) && empty($_COOKIE)) {
			$ok = false;
			$smarty->assign('msg_poll', tra('For you to vote, cookies must be allowed'));
			$smarty->assign_by_ref('polls_optionId', $_REQUEST['polls_optionId']);
		} elseif (($prefs['feature_antibot'] == 'y' && empty($user)) && (!$captchalib->validate())) {
			$ok = false;
			$smarty->assign('msg_poll', $captchalib->getErrors());
			$smarty->assign_by_ref('polls_optionId', $_REQUEST['polls_optionId']);
		} else {
			global $polllib; include_once('lib/polls/polllib_shared.php');
			$poll = $polllib->get_poll($_REQUEST['polls_pollId']);
			if( empty($poll) || $poll['active'] == 'x' ) {
				$ok = false;
{'fraction_non_alphanumeric': 0.19286926994906622, 'fraction_numerical': 0.005432937181663837, 'mean_word_length': 5.163179916317992, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4510907', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1003, 'n_words': 231}