8000 Fix shortlink retrieval by pcolmer · Pull Request #2608 · YOURLS/YOURLS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix shortlink retrieval #2608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/functions-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = yourls_match_current_protocol(yourls_sanitize_url(sprintf("%s%s", $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI'])));
$url = yourls_match_current_protocol(yourls_sanitize_url(sprintf("%s%s", YOURLS_SITE, $_SERVER['REQUEST_URI'])));
yourls_redirect( yourls_sanitize_url_safe($url) );
}
}
Expand Down
8 changes: 4 additions & 4 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1951,15 +1951,15 @@ function yourls_is_mobile_device() {
}

/**
* Get request in YOURLS base (eg in 'http://sho.rt/yourls/abcd' get 'abdc')
* Get request in YOURLS base (eg in 'http://sho.rt/yourls/abcd' get 'abcd')
*
* With no parameter passed, this function will guess current page and consider
* it is the current page requested.
* For testing purposes, parameters can be passed.
*
* @since 1.5
* @param string $yourls_site Optional, YOURLS installation URL (default to constant YOURLS_SITE)
* @param string $uri Optional, page requested (default to $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] eg 'sho.rt/yourls/abcd' )
* @param string $uri Optional, page requested (default to $_SERVER['REQUEST_URI'] eg 'abcd' )
* @return string request relative to YOURLS base (eg 'abdc')
*/
function yourls_get_request($yourls_site = false, $uri = false) {
Expand All @@ -1975,8 +1975,8 @@ function yourls_get_request($yourls_site = false, $uri = false) {
$yourls_site = YOURLS_SITE;
}
if (false === $uri) {
$uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
$uri = ltrim($_SERVER['REQUEST_URI'], '/');
}

// Even though the config sample states YOURLS_SITE should be set without trailing slash...
$yourls_site = rtrim($yourls_site,'/');
Expand Down
0