<commit_before><?php

// Require configuration
require('config.php');

// Create function to display the status of a URL and link to change its status
function displayStatus ($id, $status) {

	switch ($status) {
		case 0:
			$color = 'red';
			$name = 'Disabled';
			$watdo = 'enable';
		break;
		case 1:
			$color = 'green';
			$name = 'Active';
			$watdo = 'disable';
		break;
		default:
			$color = 'orange';
			$name = 'Hidden';
			$watdo = 'enable';
	}

	$out = "<a onclick=\"return confirm('Are you sure?');\" href=\"/admin/?do=$watdo&id=$id\"><font color=\"$color\">$name</font></a>";

	return $out;
}

// Create function to create a search query for a URL
function searchURL ($field, $how, $value) {

	global $link;
	global $sortby;
	global $sorthow;
	global $limit;

	$query = 'SELECT * FROM `';
	if ($field == 'visits') {
		$query .= 'searchurlsvisits';
	} else {
		$query .= 'urls';
	}

	$query .= "` WHERE `$field` ";

	switch ($how) {
		case 'equal':
			$query .= "= ?";
		break;
		case 'notequal':
			$query .= "!= ?";
		break;
		case 'contains':
			$query .= "LIKE CONCAT('%', ?, '%')";
		break;
		case 'greater':
			$query .= "> ?";
		break;
		case 'less':
			$query .= "< ?";
		break;
	}

	$query .= " ORDER BY `$sortby` $sorthow LIMIT $limit";

	$st = $link->prepare($query);
	$st->bindValue(1, $value);<commit_msg>that wasn't the right way to fix that, this is... maybe<commit_after><?php

// Require configuration
require('config.php');

// Create function to display the status of a URL and link to change its status
function displayStatus ($id, $status) {

	switch ($status) {
		case 0:
			$color = 'red';
			$name = 'Disabled';
			$watdo = 'enable';
		break;
		case 1:
			$color = 'green';
			$name = 'Active';
			$watdo = 'disable';
		break;
		default:
			$color = 'orange';
			$name = 'Hidden';
			$watdo = 'enable';
	}

	$out = "<a onclick=\"return confirm('Are you sure?');\" href=\"/admin/?do=$watdo&id=$id\"><font color=\"$color\">$name</font></a>";

	return $out;
}

// Create function to create a search query for a URL
function searchURL ($field, $how, $value) {

	global $link;
	global $sortby;
	global $sorthow;
	global $limit;

	$query = 'SELECT * FROM `';
	if ($field == 'visits') {
		$query .= 'searchurlsvisits';
	} else {
		$query .= 'urls';
	}

	$query .= "` WHERE `$field` ";

	switch ($how) {
		case 'equal':
			$query .= "= ?";
		break;
		case 'notequal':
			$query .= "!= ?";
		break;
		case 'contains':
			$value = '%' . $value . '%';
			$query .= "LIKE ?";
		break;
		case 'greater':
			$query .= "> ?";
		break;
		case 'less':
			$query .= "< ?";
		break;
	}

	$query .= " ORDER BY `$sortby` $sorthow LIMIT $limit";

	$st = $link->prepare($query);
	$st->bindValue(1, $value);
{'fraction_non_alphanumeric': 0.2127112417340191, 'fraction_numerical': 0.002204261572373255, 'mean_word_length': 3.1509146341463414, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '864321', 'n_tokens_mistral': 1136, 'n_tokens_neox': 998, 'n_words': 274}