<commit_before><?php
class website_IndexAction extends f_action_BaseAction
{
	/**
	 * @param Context $context
	 * @param Request $request
	 */
	public function _execute($context, $request)
	{
		try 
		{
			$host = $_SERVER['HTTP_HOST'];
			website_UrlRewritingService::getInstance()->initCurrrentWebsite($host);
			$ws = website_WebsiteModuleService::getInstance();
			$website = $ws->getCurrentWebsite();
			$homePage = $ws->getIndexPage($website, false);
			if ($homePage  === null || !$homePage->isPublished())
			{
				throw new Exception('Website has no published home page');
			}
			$request->setParameter(K::PAGE_REF_ACCESSOR, $homePage->getId());
			$context->getController()->forward('website', 'Display');
		} 
		catch (Exception $e) 
		{
			Framework::exception($e);
			require(f_util_FileUtils::buildWebeditPath("site-disabled.php"));
		}		
		return View::NONE ;
	}

	/**
	 * @return string
	 */
	public function getRequestMethods()
	{
		return Request::GET | Request::POST;
	}

	/**
	 * @return boolean
	 */
	public function isSecure()
	{
		return false;
	}
}<commit_msg>[FIX #56181] URL de la page d'accueil d'un site et localisation par chemin<commit_after><?php
class website_IndexAction extends f_action_BaseAction
{
	/**
	 * @param Context $context
	 * @param Request $request
	 */
	public function _execute($context, $request)
	{
		try 
		{
			$host = $_SERVER['HTTP_HOST'];
			website_UrlRewritingService::getInstance()->initCurrrentWebsite($host);
			$ws = website_WebsiteModuleService::getInstance();
			$website = $ws->getCurrentWebsite();
			if ($website->getLocalizebypath())
			{
				if (Framework::isInfoEnabled())
				{
					Framework::info(__METHOD__ . ' redirect on VO homepage');
				}
				$request->setParameter('location', LinkHelper::getDocumentUrl($website, $website->getLang()));
				$context->getController()->forward('website', 'Redirect');
			}
			else
			{		
				$homePage = $ws->getIndexPage($website, false);
				if ($homePage  === null || !$homePage->isPublished())
				{
					throw new Exception('Website has no published home page');
				}
				$request->setParameter(K::PAGE_REF_ACCESSOR, $homePage->getId());
				$context->getController()->forward('website', 'Display');
			}
		} 
		catch (Exception $e) 
		{
			Framework::exception($e);
			require(f_util_FileUtils::buildWebeditPath("site-disabled.php"));
		}		
		return View::NONE ;
	}

	/**
	 * @return string
	 */
	public function getRequestMethods()
	{
		return Request::GET | Request::POST;
	}

	/**
	 * @return boolean
	 */
	public function isSecure()
	{
		return false;
	}
}
{'fraction_non_alphanumeric': 0.1609150833656456, 'fraction_numerical': 0.0019387359441644049, 'mean_word_length': 4.16, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '6933156', 'n_tokens_mistral': 962, 'n_tokens_neox': 801, 'n_words': 155}