1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Daniel Neto 2023-03-23 08:23:49 -03:00
parent aec0b57ddd
commit 3c969b4a52
6 changed files with 349 additions and 109 deletions

View file

@ -1,15 +1,17 @@
<?php
if (empty($config)) {
return true;
}
// filter some security here
if (!empty($_GET['lang'])) {
$_GET['lang'] = str_replace(["'", '"', "&quot;", "&#039;"], ['', '', '', ''], xss_esc($_GET['lang']));
}
@include_once "{$global['systemRootPath']}locale/{$_SESSION['language']}.php";
includeLangFile();
function includeLangFile(){
global $t;
setSiteLang();
@include_once "{$global['systemRootPath']}locale/{$_SESSION['language']}.php";
}
function __($str, $allowHTML = false)
{
@ -120,8 +122,15 @@ function flag2Lang($flagCode)
function setSiteLang()
{
global $config;
global $config, $global;
if(empty($config)){
if(!class_exists('Configuration')){
require $global['systemRootPath'] . 'objects/configuration.php';
}
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
$config = new Configuration();
}
$userLocation = false;
$obj = AVideoPlugin::getDataObjectIfEnabled('User_Location');
$userLocation = !empty($obj) && !empty($obj->autoChangeLanguage);