<commit_before><?php
App::uses('AppHelper', 'View/Helper');

//this helper simply replaces quotes between [QUOTE][/QUOTE] with div tags.

	class CommandHelper extends AppHelper {
		public function convertQuotes($string){
			$string = str_ireplace('[QUOTE]', '<div class="quote">', $string);
			$string = str_ireplace('[/QUOTE]', '</div>', $string);
			$matches = array();
			while (preg_match ('%\[event\](.*?)\[/event\]%is', $string, $matches)) {
				if (!empty($matches) && is_numeric($matches[1])) {
					$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '<a href=/events/view/' . $matches[1] . '> Event ' . $matches[1] . '</a>', $string);
				} else {
					$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '%Malformed_Event_Link%', $string);
				}
			}
			$matches = array();
			while (preg_match ('%\[thread\](.*?)\[/thread\]%is', $string, $matches)) {
				if (!empty($matches) && is_numeric($matches[1])) {
					$string = preg_replace('%\[thread\]' . $matches[1] . '\[/thread\]%i', '<a href=/threads/view/' . $matches[1] . '> Thread ' . $matches[1] . '</a>', $string);
				} else {
					$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '%Malformed_Thread_Link%', $string);
				}
				$matches = array();
			}
			return $string;
		}
	}
?><commit_msg>Serious bug with the discussion boards<commit_after><?php
App::uses('AppHelper', 'View/Helper');

//this helper simply replaces quotes between [QUOTE][/QUOTE] with div tags.

	class CommandHelper extends AppHelper {
		public function convertQuotes($string){
			$string = str_ireplace('[QUOTE]', '<div class="quote">', $string);
			$string = str_ireplace('[/QUOTE]', '</div>', $string);
			$matches = array();
			while (preg_match ('%\[event\](.*?)\[/event\]%is', $string, $matches)) {
				if (!empty($matches) && is_numeric($matches[1])) {
					$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '<a href=/events/view/' . $matches[1] . '> Event ' . $matches[1] . '</a>', $string);
				} else {
					$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '%Malformed_Event_Link%', $string);
				}
			}
			$matches = array();
			
			while (preg_match ('%\[thread\](.*?)\[/thread\]%is', $string, $matches)) {
				if (!empty($matches) && is_numeric($matches[1])) {
					$string = preg_replace('%\[thread\]' . $matches[1] . '\[/thread\]%i', '<a href=/threads/view/' . $matches[1] . '> Thread ' . $matches[1] . '</a>', $string);
				} else {
					$string = preg_replace('%\[thread\]' . $matches[1] . '\[/thread\]%i', '%Malformed_Thread_Link%', $string);
				}
				$matches = array();
			}
			
			return $string;
		}
	}
?>
{'fraction_non_alphanumeric': 0.2613935969868173, 'fraction_numerical': 0.007532956685499058, 'mean_word_length': 3.611111111111111, 'pattern_counts': {'":': 0, '<': 17, '<?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': '5374569', 'n_tokens_mistral': 1081, 'n_tokens_neox': 942, 'n_words': 183}