<commit_before><?
// The source code packaged with this file is Free Software, Copyright (C) 2010 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once('../config.php');

$type = $db->escape($_GET['type']);
$id = intval($_GET['id']);
if (empty($_GET['version'])) $version = 0;
else $version = intval($_GET['version']);

if (empty($type) || ! $id ) not_found();

$media = new Upload($type, $id, $version);

if (! $media->read()) not_found();

if (true || $media->access == 'public' || $current_user->user_id > 0) {
	header("Content-Type: $media->mime");
	header('Last-Modified: ' . date('r', $media->date));
	header('Cache-Control: max-age=3600');
	if (! empty($globals['xsendfile'])) {
		header($globals['xsendfile'].': '.$media->url());
	} else {
		if ($media->size > 0) {
			header("Content-Length: $media->size");
		}
		$media->readfile();
	}
} else {
	header("Content-Type: text/html");
	echo '<b>'._('Debe estar autentificado para ver esta imagen') . '</b>';
}
exit(0);
?><commit_msg>Removed "true" used for debugging<commit_after><?
// The source code packaged with this file is Free Software, Copyright (C) 2010 by
// <NAME> <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
//		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once('../config.php');

$type = $db->escape($_GET['type']);
$id = intval($_GET['id']);
if (empty($_GET['version'])) $version = 0;
else $version = intval($_GET['version']);

if (empty($type) || ! $id ) not_found();

$media = new Upload($type, $id, $version);

if (! $media->read()) not_found();

if ($media->access == 'public' || $current_user->user_id > 0) {
	header("Content-Type: $media->mime");
	header('Last-Modified: ' . date('r', $media->date));
	header('Cache-Control: max-age=3600');
	if (! empty($globals['xsendfile'])) {
		header($globals['xsendfile'].': '.$media->url());
	} else {
		if ($media->size > 0) {
			header("Content-Length: $media->size");
		}
		$media->readfile();
	}
} else {
	header("Content-Type: text/html");
	echo '<b>'._('Debe estar autentificado para ver esta imagen') . '</b>';
}
exit(0);
?>
{'fraction_non_alphanumeric': 0.21555915721231766, 'fraction_numerical': 0.009724473257698542, 'mean_word_length': 4.548314606741573, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5093657', 'n_tokens_mistral': 890, 'n_tokens_neox': 836, 'n_words': 231}