Fossil SCM

fixed duplication of QUERY_STRING in the redirection URL in login_needed function

sdr 2020-12-12 23:20 trunk
Commit 1650a643613ea28059b18b52552b31d5bb3e91e2a6eafdc52a4a42119010c85b
1 file changed +4 -4
+4 -4
--- src/login.c
+++ src/login.c
@@ -1422,22 +1422,22 @@
14221422
/* NOTREACHED */
14231423
assert(0);
14241424
}else
14251425
#endif /* FOSSIL_ENABLE_JSON */
14261426
{
1427
+ /*
1428
+ ** Note: REQUEST_URI already includes QUERY_STRING, so there
1429
+ ** is no need to append the QUERY_STRING to the redir blob.
1430
+ */
14271431
const char *zUrl = PD("REQUEST_URI", "index");
1428
- const char *zQS = P("QUERY_STRING");
14291432
Blob redir;
14301433
blob_init(&redir, 0, 0);
14311434
if( fossil_wants_https(1) ){
14321435
blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
14331436
}else{
14341437
blob_appendf(&redir, "%R/login?g=%T", zUrl);
14351438
}
1436
- if( zQS && zQS[0] ){
1437
- blob_appendf(&redir, "%%3f%T", zQS);
1438
- }
14391439
if( anonOk ) blob_append(&redir, "&anon", 5);
14401440
cgi_redirect(blob_str(&redir));
14411441
/* NOTREACHED */
14421442
assert(0);
14431443
}
14441444
--- src/login.c
+++ src/login.c
@@ -1422,22 +1422,22 @@
1422 /* NOTREACHED */
1423 assert(0);
1424 }else
1425 #endif /* FOSSIL_ENABLE_JSON */
1426 {
 
 
 
 
1427 const char *zUrl = PD("REQUEST_URI", "index");
1428 const char *zQS = P("QUERY_STRING");
1429 Blob redir;
1430 blob_init(&redir, 0, 0);
1431 if( fossil_wants_https(1) ){
1432 blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
1433 }else{
1434 blob_appendf(&redir, "%R/login?g=%T", zUrl);
1435 }
1436 if( zQS && zQS[0] ){
1437 blob_appendf(&redir, "%%3f%T", zQS);
1438 }
1439 if( anonOk ) blob_append(&redir, "&anon", 5);
1440 cgi_redirect(blob_str(&redir));
1441 /* NOTREACHED */
1442 assert(0);
1443 }
1444
--- src/login.c
+++ src/login.c
@@ -1422,22 +1422,22 @@
1422 /* NOTREACHED */
1423 assert(0);
1424 }else
1425 #endif /* FOSSIL_ENABLE_JSON */
1426 {
1427 /*
1428 ** Note: REQUEST_URI already includes QUERY_STRING, so there
1429 ** is no need to append the QUERY_STRING to the redir blob.
1430 */
1431 const char *zUrl = PD("REQUEST_URI", "index");
 
1432 Blob redir;
1433 blob_init(&redir, 0, 0);
1434 if( fossil_wants_https(1) ){
1435 blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
1436 }else{
1437 blob_appendf(&redir, "%R/login?g=%T", zUrl);
1438 }
 
 
 
1439 if( anonOk ) blob_append(&redir, "&anon", 5);
1440 cgi_redirect(blob_str(&redir));
1441 /* NOTREACHED */
1442 assert(0);
1443 }
1444

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button