From c6de7fa2704ad9f98d6ab81b58b019769ae4184a Mon Sep 17 00:00:00 2001 From: ozh Date: Sat, 25 Mar 2017 19:35:20 +0100 Subject: [PATCH] Fix redirection after logging Fixes #2213. Fixes #2206. --- includes/functions-auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions-auth.php b/includes/functions-auth.php index 744edd0..ddc3bf8 100644 --- a/includes/functions-auth.php +++ b/includes/functions-auth.php @@ -80,7 +80,7 @@ function yourls_is_valid_user() { // Login form : redirect to requested URL to avoid re-submitting the login form on page reload if( isset( $_REQUEST['username'] ) && isset( $_REQUEST['password'] ) && isset( $_SERVER['REQUEST_URI'] ) ) { - $url = $_SERVER['REQUEST_URI']; + $url = yourls_match_current_protocol(yourls_sanitize_url(sprintf("%s%s", $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI']))); yourls_redirect( yourls_sanitize_url_safe($url) ); } } -- 2.42.0