Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion fork/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php
error_reporting(E_ALL ^ E_WARNING);

// --- Polyfill for str_contains() (PHP < 8.0) ---
if (!function_exists('str_contains')) {
function str_contains (string $haystack, string $needle): bool
{
return empty($needle) || strpos($haystack, $needle) !== false;
}
}

# Constants
define("USER_AGENT", $_SERVER['HTTP_USER_AGENT']);
define("IS_NEOS", str_contains(USER_AGENT, "NEOSSetup"));
Expand All @@ -9,7 +17,7 @@
# Use release2 if NEOS, else release3 (careful! wget assumes comma three)
define("DEFAULT_STOCK_BRANCH", IS_NEOS ? "release2" : "release3");

define("WEBSITE_URL", "https://smiskol.com");
define("WEBSITE_URL", (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]");
define("BASE_DIR", "/" . basename(__DIR__));

function logData() {
Expand Down