Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 22eee0e

Browse files
refactor: Changed request_scheme to use https var key
1 parent 0e8031e commit 22eee0e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎DbClass.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ private static function getCurrentPage($object = false)
404404
}
405405
}
406406
} else {
407-
$url = $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
407+
$request_scheme = "https";
408+
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') {
409+
$request_scheme = "http";
410+
}
411+
$url = $request_scheme . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
408412
if (preg_match("/\?{1,}/", $url)) {
409413
$url = explode("?", $url)[0];
410414
if (isset($_GET[$words['url']])) {
@@ -430,14 +434,18 @@ public static function page($echo = true, $class = "")
430434
if (!isset(self::$pageObject->extra['words'])) {
431435
self::setPaginationWords(self::$pageObject);
432436
}
437+
$request_scheme = "https";
438+
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') {
439+
$request_scheme = "http";
440+
}
433441
$words = self::$pageObject->extra['words'];
434442
$totalPages = ceil($totalRows / $limit);
435443
$pageNow = self::getCurrentPage(self::$pageObject);
436444
if ($class) {
437445
$words['class'] . "" . $class . "";
438446
}
439447
if (self::$friendlyURL !== false) {
440-
$url = $_SERVER['REQUEST_SCHEME'] . "://" . self::$friendlyURL->getSite();
448+
$url = $request_scheme . "://" . self::$friendlyURL->getSite();
441449
$parts = self::$friendlyURL->getParts();
442450
$keyPart = null;
443451
foreach ($parts as $key => $part) {
@@ -447,7 +455,7 @@ public static function page($echo = true, $class = "")
447455
}
448456
}
449457
} else {
450-
$url = $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
458+
$url = $request_scheme . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
451459
if (preg_match("/\?{1,}/", $url)) {
452460
$url = explode("?", $url)[0];
453461
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /