Skip to content

Commit

Permalink
Fix lang value was always en
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Dec 26, 2024
1 parent 5c74bc3 commit 0218953
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions js/search-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@

use phpweb\I18n\Languages;

$_GET["lang"] = "en";
if (!isset($_GET["lang"])) {
header("Location: http://php.net");
exit;
}
$lang = $_GET["lang"] ?? "en";
if (empty($_SERVER["DOCUMENT_ROOT"])) {
$_SERVER["DOCUMENT_ROOT"] = __DIR__ . "/../";
}
include __DIR__ . '/../include/prepend.inc';
if (!isset(Languages::ACTIVE_ONLINE_LANGUAGES[$_GET["lang"]])) {
if (!isset(Languages::ACTIVE_ONLINE_LANGUAGES[$lang])) {
header("Location: http://php.net");
}
$lang = $_GET["lang"];

/*
$types = array(
Expand Down

0 comments on commit 0218953

Please sign in to comment.