<commit_before><?php
/**
 * @package mobile
 */
class MobileSiteTreeExtension extends DataExtension {
	
	function MetaTags(&$tags) {
		$config = SiteConfig::current_site_config();

		// Ensure a canonical link is placed, for semantic correctness and SEO
		if(Controller::has_curr() && Controller::curr()->hasMethod("onMobileDomain") && Controller::curr()->onMobileDomain() && $config->MobileSiteType == 'RedirectToDomain') {
			$oldBaseURL = Director::baseURL();
			Director::setbaseURL($config->FullSiteDomain);
			$tags .= sprintf('<link rel="canonical" href="%s" />', $this->owner->AbsoluteLink()) . "\n";
			Director::setbaseURL($oldBaseURL);
		}
	}
	
}<commit_msg>Fixing deprecated use of Director::setBaseURL()<commit_after><?php
/**
 * @package mobile
 */
class MobileSiteTreeExtension extends DataExtension {
	
	function MetaTags(&$tags) {
		$config = SiteConfig::current_site_config();

		// Ensure a canonical link is placed, for semantic correctness and SEO
		if(Controller::has_curr() && Controller::curr()->hasMethod("onMobileDomain") && Controller::curr()->onMobileDomain() && $config->MobileSiteType == 'RedirectToDomain') {
			$oldBaseURL = Director::baseURL();

			Config::inst()->update('Director', 'alternate_base_url', $config->FullSiteDomain);
			$tags .= sprintf('<link rel="canonical" href="%s" />', $this->owner->AbsoluteLink()) . "\n";
			Config::inst()->update('Director', 'alternate_base_url', $oldBaseURL);
		}
	}
	
}
{'fraction_non_alphanumeric': 0.18269896193771626, 'fraction_numerical': 0.0, 'mean_word_length': 5.951923076923077, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '5427473', 'n_tokens_mistral': 457, 'n_tokens_neox': 417, 'n_words': 82}