mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Small patch
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
class Misc {
|
||||
static private function isSecure() {
|
||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
|
||||
}
|
||||
|
||||
static public function getCursor(): int {
|
||||
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
||||
}
|
||||
@@ -11,7 +15,7 @@ class Misc {
|
||||
}
|
||||
|
||||
static public function url(string $endpoint = ''): string {
|
||||
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
|
||||
$protocol = self::isSecure() ? 'https' : 'http';
|
||||
$root = $protocol . '://' . $_SERVER['HTTP_HOST'];
|
||||
return $root . self::env('APP_PATH', '') . $endpoint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user