mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-10-22 08:08:52 +00:00
Added redirect feature depends on language.
This commit is contained in:
1 parent
cb19bd9d4a
commit
6d0f0f9ab7
3 files changed
+43
-2
No files matched your search
@@ -383,4 +383,38 @@
|
||||
}
|
||||
return $g_lang[$name];
|
||||
}
|
||||
|
||||
// Requare redirect
|
||||
function GetRedirectURL()
|
||||
{
|
||||
global $g_arrLangs;
|
||||
// Language doesn't have special domain.
|
||||
if (!isset($g_arrLangs[LANG]['domain']))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
$newDomain = $g_arrLangs[LANG]['domain'];
|
||||
|
||||
// If we have any params then ignore redirect.
|
||||
if (count(array_values($_GET)) > 1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Skip for localhost
|
||||
if (strcasecmp($_SERVER['SERVER_NAME'], '127.0.0.1') == 0
|
||||
||
|
||||
strcasecmp($_SERVER['SERVER_NAME'], 'localhost') == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Domain is the same.
|
||||
if (strcasecmp($_SERVER['SERVER_NAME'], $newDomain) == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $_SERVER['REQUEST_SCHEME'] . "://" . $newDomain . $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user