Fix bad sync codes when URL setting is not absolute
This commit is contained in:
parent
43385f73ee
commit
764d526305
@ -35,7 +35,11 @@ if (MOBILE_ENABLED) {
|
||||
$code = strtoupper(substr(md5(mt_rand() . uniqid("", true)), 0, 20));
|
||||
$database->insert('mobile_codes', ['uid' => $_SESSION['uid'], 'code' => $code]);
|
||||
}
|
||||
$url = URL . "mobile/index.php";
|
||||
if (strpos(URL, "http") !== FALSE) {
|
||||
$url = URL . "mobile/index.php";
|
||||
} else {
|
||||
$url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . URL . "mobile/index.php";
|
||||
}
|
||||
$encodedurl = str_replace("/", "\\", $url);
|
||||
$codeuri = "bizsync://" . $encodedurl . "/" . $_SESSION['username'] . "/" . $code;
|
||||
$qrCode = new QrCode($codeuri);
|
||||
|
Loading…
x
Reference in New Issue
Block a user