get_text('croatiayacht', $entity, $language); } function h($s) { return(htmlspecialchars($s ?? '')); } $mod = array(); if (isset($_GET['mod']) && !empty($_GET['mod'])) { $mod = explode("/", $_GET['mod']); } if (isset($_POST['mod']) && !empty($_POST['mod'])) { $mod = explode("/", $_POST['mod']); } if(!empty($mod)) { foreach ($mod as $key => $value) { if (empty($value)) { unset($mod[$key]); } } // Reindexácia poľa po premazaní $mod = array_values($mod); } // ake jazyky maju byt zapnute na webe/admine $A_project_allowed_language = array("en", "de", "ru", "pl", "ro", "hu", "cz", "sk"); if(isset($mod['0'])) { if(!in_array($mod['0'], $A_project_allowed_language)) { header("HTTP/1.1 301 Moved Permanently"); header("Location: " . HTTP_PATH); exit(); } } else { $quesed = Language::getBestMatch($A_project_allowed_language); if(!in_array($quesed, $A_project_allowed_language)) { header("HTTP/1.1 301 Moved Permanently"); header("Location: " . HTTP_PATH .'/'. $A_project_allowed_language['0'].'/'.A_text("licence_url", $A_project_allowed_language['0']).'.html'); exit(); } else { header("HTTP/1.1 301 Moved Permanently"); header("Location: " . HTTP_PATH .'/'. $quesed .'/'. A_text("licence_url", $quesed).'.html'); exit(); } } define('A_LANGUAGE', $mod['0']); // Bezpečné ošetrenie mod[1] pre PHP 8.2 $mod_1 = isset($mod['1']) ? $mod['1'] : ''; $allowed_sites = array(A_text("licence_url")); if(!in_array($mod_1, $allowed_sites)) { header("HTTP/1.1 301 Moved Permanently"); header("Location: " . HTTP_PATH); exit(); } if(!isset($_SESSION['message_green'])) $_SESSION['message_green'] = array(); if(!isset($_SESSION['message_red'])) $_SESSION['message_red'] = array(); ?>