<commit_before><?php
/**
 * Email template loader library.
 * 
 * @author <NAME>.
 * @license http://opensource.org/licenses/MIT
 * 
 */

namespace Extension;

class EmailTemplate
{


	/**
	 * read template
	 * 
	 * @author <NAME>.
	 * @param string $email_file email file.
	 * @param string $template_path path to folder that store email file.
	 * @return mixed
	 */
	public static function readTemplate($email_file = '', $template_path = null) 
	{
		if ($email_file == null) {return null;}
		
		if ($template_path == null) {
			$template_path = APPPATH . 'lang' . DS . \Lang::get_lang() . DS . 'email' . DS;
		}
		
		if (file_exists($template_path . $email_file)) {
			$site_name = \Model_Config::getval('site_name');
			
			$output = file_get_contents($template_path.$email_file);
			$output = str_replace("%site_name%", $site_name, $output);
			$output = str_replace("%site_url%", \Uri::base(), $output);
			$output = str_replace("%site_admin%", \Uri::create('site-admin'), $output);
			
			unset($site_name, $template_path);
			
			return $output;
		} else {
			return false;
		}
	}// readTemplate


}
<commit_msg>email template wrong link to admin page<commit_after><?php
/**
 * Email template loader library.
 * 
 * @author <NAME>.
 * @license http://opensource.org/licenses/MIT
 * 
 */

namespace Extension;

class EmailTemplate
{


	/**
	 * read template
	 * 
	 * @author <NAME>.
	 * @param string $email_file email file.
	 * @param string $template_path path to folder that store email file.
	 * @return mixed
	 */
	public static function readTemplate($email_file = '', $template_path = null) 
	{
		if ($email_file == null) {return null;}
		
		if ($template_path == null) {
			$template_path = APPPATH . 'lang' . DS . \Lang::get_lang() . DS . 'email' . DS;
		}
		
		if (file_exists($template_path . $email_file)) {
			$site_name = \Model_Config::getval('site_name');
			
			$output = file_get_contents($template_path.$email_file);
			$output = str_replace("%site_name%", $site_name, $output);
			$output = str_replace("%site_url%", \Uri::base(), $output);
			$output = str_replace("%site_admin%", \Uri::create('admin'), $output);
			
			unset($site_name, $template_path);
			
			return $output;
		} else {
			return false;
		}
	}// readTemplate


}

{'fraction_non_alphanumeric': 0.16423196104471005, 'fraction_numerical': 0.0, 'mean_word_length': 3.538152610441767, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '2130252', 'n_tokens_mistral': 841, 'n_tokens_neox': 736, 'n_words': 172}