<commit_before><?php

defined('C5_EXECUTE') or die("Access Denied.");
class DownloadFileController extends Controller {

	/** 
	 * Automatically loads the file block class
	 */
	public function on_start() {
		Loader::block('file');
	}

	public function view($fID = 0, $rcID=NULL) {
		// get the block
		if ($fID > 0) {
			$file = File::getByID($fID);			
			if ($file) {				
				
				$fp = new Permissions($file);
				if (!$fp->canRead()) {
					return false;
				}
				
				// if block password is blank download
				if (!$file->getPassword()) {
					return $this->download($file,$rcID);			
				}
				// otherwise show the form
				$this->set('rcID',$rcID);
				$this->set('fID', $fID);
				$this->set('filename', $file->getFilename());
				$this->set('filesize', filesize( $file->getPath() ) );
			}			
		}
	}
	
	public function view_inline($fID) {
		$file = File::getByID($fID);
		$fp = new Permissions($file);
		if (!$fp->canRead()) {
			return false;<commit_msg>stupid functions<commit_after><?php

defined('C5_EXECUTE') or die("Access Denied.");
class DownloadFileController extends Controller {

	/** 
	 * Automatically loads the file block class
	 */
	public function on_start() {
		Loader::block('file');
	}

	public function view($fID = 0, $rcID=NULL) {
		// get the block
		if ($fID > 0) {
			$file = File::getByID($fID);			
			if ($file) {				
				
				$fp = new Permissions($file);
				if (!$fp->canRead()) {
					return false;
				}
				
				// if block password is blank download
				if (!$file->getPassword()) {
					return $this->download($file,$rcID);			
				}
				// otherwise show the form
				$this->set('rcID',$rcID);
				$this->set('fID', $fID);
				$this->set('filename', $file->getFilename());
				$this->set('filesize', filesize( $file->getPath() ) );
			}			
		}
	}
	
	public function view_inline($fID = 0) {
		$file = File::getByID($fID);
		$fp = new Permissions($file);
		if (!$fp->canRead()) {
			return false;
{'fraction_non_alphanumeric': 0.18720990201134605, 'fraction_numerical': 0.0036101083032490976, 'mean_word_length': 2.9917695473251027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7048052', 'n_tokens_mistral': 820, 'n_tokens_neox': 661, 'n_words': 151}