<commit_before><?php

/*
* Copyright 2016 <NAME>
*
* This file is part of Facade, and is made available under the terms of the GNU
* General Public License version 2.
* SPDX-License-Identifier:        GPL-2.0
*/

include_once "includes/db.php";
$db = setup_db();

$project = array();
$tags = array();

// Handle custom dates
if ($_GET["start"] == 'custom') {
	$start_date = sanitize_input($db,$_GET["start_date"],10);
	$date_clause = $date_clause . " AND m.start_date >= '" . $start_date . "'";
}

if ($_GET["end"] == 'custom') {
	$end_date = sanitize_input($db,$_GET["end_date"],10);
	$date_clause = $date_clause . " AND m.start_date <= '" . $end_date . "'";
}

// If dates are actually out of order, reset the clause and return everything
if (isset($_GET["start"]) &&
isset($_GET["end"]) &&
$start_date > $end_date) {
	$date_clause = "";
}

// Normalize a request for specific repos, or fall back to all repos
if (isset($_GET["projects"])) {
	foreach ($_GET["projects"] as $project) {
		$projects[] = sanitize_input($db,$project,11);
	}<commit_msg>Fixed date selection on results page.<commit_after><?php

/*
* Copyright 2016 <NAME>
*
* This file is part of Facade, and is made available under the terms of the GNU
* General Public License version 2.
* SPDX-License-Identifier:        GPL-2.0
*/

include_once "includes/db.php";
$db = setup_db();

$project = array();
$tags = array();

// Handle custom dates
if ($_GET["start"] == 'custom') {
	$start_date = sanitize_input($db,$_GET["start_date"],10);
	$date_clause = $date_clause . " AND m.start_date >= '" . $start_date . "'";
}

if ($_GET["end"] == 'custom') {
	$end_date = sanitize_input($db,$_GET["end_date"],10);
	$date_clause = $date_clause . " AND m.start_date <= '" . $end_date . "'";
}

// If dates are actually out of order, reset the clause and return everything
if ($_GET["start"] == 'custom' &&
$_GET["end"] == 'custom' &&
$start_date > $end_date) {
	$date_clause = "";
}

// Normalize a request for specific repos, or fall back to all repos
if (isset($_GET["projects"])) {
	foreach ($_GET["projects"] as $project) {
		$projects[] = sanitize_input($db,$project,11);
	}
{'fraction_non_alphanumeric': 0.18791002811621368, 'fraction_numerical': 0.01218369259606373, 'mean_word_length': 4.460358056265985, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3665022', 'n_tokens_mistral': 764, 'n_tokens_neox': 740, 'n_words': 201}