Jump to content

Site Language change problem


jpayam
 Share

Recommended Posts

This is my very initial guess at changing this.

The reason this ends up looking like it does is because another fix was needed to stop crashes in other situations.

In /controllers/controller.index.inc.php, near line 38, find:

//Initialize language
$GLOBALS['language'] = Language::getInstance();
//Initialize hooks
$GLOBALS['hooks'] = HookLoader::getInstance();
//Initialize SSL
$GLOBALS['ssl'] = SSL::getInstance();
//Initialize SEO
$GLOBALS['seo'] = SEO::getInstance();
if (isset($_GET['seo_path']) && !empty($_GET['seo_path'])) {
	$_GET['seo_path'] = preg_replace('/(\/\~[a-z0-9]{1,}\/)/', '', $_GET['seo_path']); // Remove /~username/ from seo_path
	$GLOBALS['seo']->getItem($_GET['seo_path']);
}

Change to:

//Initialize hooks
$GLOBALS['hooks'] = HookLoader::getInstance();
//Initialize SSL
$GLOBALS['ssl'] = SSL::getInstance();
//Initialize SEO
$GLOBALS['seo'] = SEO::getInstance();
//Initialize language
$GLOBALS['language'] = Language::getInstance();
if (isset($_GET['seo_path']) && !empty($_GET['seo_path'])) {
	$_GET['seo_path'] = preg_replace('/(\/\~[a-z0-9]{1,}\/)/', '', $_GET['seo_path']); // Remove /~username/ from seo_path
	$GLOBALS['seo']->getItem($_GET['seo_path']);
}

The above has been tested only to show that after the customer changes to a different language, the URL is still "friendly".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...