Fossil SCM

When redirecting to /xfer, make sure the PATH_INFO actually exists. Update the cgi_replace_parameter() routine to make sure the parameter being replaced already exists.

drh 2008-05-29 14:37 trunk
Commit e5b72926206b0659157c3c81b471f84ecab10f86
1 file changed +2
+2
--- src/cgi.c
+++ src/cgi.c
@@ -427,12 +427,14 @@
427427
void cgi_replace_parameter(const char *zName, const char *zValue){
428428
int i;
429429
for(i=0; i<nUsedQP; i++){
430430
if( strcmp(aParamQP[i].zName,zName)==0 ){
431431
aParamQP[i].zValue = zValue;
432
+ return
432433
}
433434
}
435
+ cgi_set_parameter_nocopy(zName, zValue);
434436
}
435437
436438
/*
437439
** Add a query parameter. The zName portion is fixed but a copy
438440
** must be made of zValue.
439441
--- src/cgi.c
+++ src/cgi.c
@@ -427,12 +427,14 @@
427 void cgi_replace_parameter(const char *zName, const char *zValue){
428 int i;
429 for(i=0; i<nUsedQP; i++){
430 if( strcmp(aParamQP[i].zName,zName)==0 ){
431 aParamQP[i].zValue = zValue;
 
432 }
433 }
 
434 }
435
436 /*
437 ** Add a query parameter. The zName portion is fixed but a copy
438 ** must be made of zValue.
439
--- src/cgi.c
+++ src/cgi.c
@@ -427,12 +427,14 @@
427 void cgi_replace_parameter(const char *zName, const char *zValue){
428 int i;
429 for(i=0; i<nUsedQP; i++){
430 if( strcmp(aParamQP[i].zName,zName)==0 ){
431 aParamQP[i].zValue = zValue;
432 return
433 }
434 }
435 cgi_set_parameter_nocopy(zName, zValue);
436 }
437
438 /*
439 ** Add a query parameter. The zName portion is fixed but a copy
440 ** must be made of zValue.
441

Keyboard Shortcuts

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