We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ab010e commit c441e3dCopy full SHA for c441e3d
libs/csrf/csrfprotector.php
@@ -422,8 +422,19 @@ private static function logCSRFattack()
422
*/
423
private static function getCurrentUrl()
424
{
425
- return $_SERVER['REQUEST_SCHEME'] .'://'
426
- .$_SERVER['HTTP_HOST'] .$_SERVER['PHP_SELF'];
+ $request_scheme = 'https';
+
427
+ if (isset($_SERVER['REQUEST_SCHEME'])) {
428
+ $request_scheme = $_SERVER['REQUEST_SCHEME'];
429
+ } else {
430
+ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
431
432
433
+ $request_scheme = 'http';
434
+ }
435
436
437
+ return $request_scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
438
}
439
440
/*
0 commit comments