| | @@ -562,25 +562,10 @@ |
| 562 | 562 | */ |
| 563 | 563 | void cgi_setenv(const char *zName, const char *zValue){ |
| 564 | 564 | cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0); |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | | - |
| 568 | | -/* |
| 569 | | -** Returns non-zero if the specified character is lowercase -OR- |
| 570 | | -** the specified character is uppercase and the CGI subsystem has |
| 571 | | -** been configured to allow uppercase parameter names. |
| 572 | | -*/ |
| 573 | | -int cgi_char_allowed(char c){ |
| 574 | | - if( fossil_islower(c) ){ |
| 575 | | - return 1; /* lowercase letter, always OK */ |
| 576 | | - }else if( fossil_isupper(c) && g.cgiUpperParamsOk ){ |
| 577 | | - return 1; /* uppercase letter, OK if allowed explicitly */ |
| 578 | | - } |
| 579 | | - return 0; /* something else, never OK */ |
| 580 | | -} |
| 581 | | - |
| 582 | 567 | /* |
| 583 | 568 | ** Add a list of query parameters or cookies to the parameter set. |
| 584 | 569 | ** |
| 585 | 570 | ** Each parameter is of the form NAME=VALUE. Both the NAME and the |
| 586 | 571 | ** VALUE may be url-encoded ("+" for space, "%HH" for other special |
| | @@ -629,11 +614,11 @@ |
| 629 | 614 | dehttpize(zValue); |
| 630 | 615 | }else{ |
| 631 | 616 | if( *z ){ *z++ = 0; } |
| 632 | 617 | zValue = ""; |
| 633 | 618 | } |
| 634 | | - if( cgi_char_allowed(zName[0]) && fossil_no_strange_characters(zName+1) ){ |
| 619 | + if( fossil_islower(zName[0]) && fossil_no_strange_characters(zName+1) ){ |
| 635 | 620 | cgi_set_parameter_nocopy(zName, zValue, isQP); |
| 636 | 621 | } |
| 637 | 622 | #ifdef FOSSIL_ENABLE_JSON |
| 638 | 623 | json_setenv( zName, cson_value_new_string(zValue,strlen(zValue)) ); |
| 639 | 624 | #endif /* FOSSIL_ENABLE_JSON */ |
| | @@ -773,11 +758,11 @@ |
| 773 | 758 | if( zBoundry==0 ) return; |
| 774 | 759 | while( (zLine = get_line_from_string(&z, &len))!=0 ){ |
| 775 | 760 | if( zLine[0]==0 ){ |
| 776 | 761 | int nContent = 0; |
| 777 | 762 | zValue = get_bounded_content(&z, &len, zBoundry, &nContent); |
| 778 | | - if( zName && zValue && cgi_char_allowed(zName[0]) ){ |
| 763 | + if( zName && zValue && fossil_islower(zName[0]) ){ |
| 779 | 764 | cgi_set_parameter_nocopy(zName, zValue, 1); |
| 780 | 765 | if( showBytes ){ |
| 781 | 766 | cgi_set_parameter_nocopy(mprintf("%s:bytes", zName), |
| 782 | 767 | mprintf("%d",nContent), 1); |
| 783 | 768 | } |
| | @@ -793,17 +778,17 @@ |
| 793 | 778 | i++; |
| 794 | 779 | }else if( c=='n' && sqlite3_strnicmp(azArg[i],"name=",n)==0 ){ |
| 795 | 780 | zName = azArg[++i]; |
| 796 | 781 | }else if( c=='f' && sqlite3_strnicmp(azArg[i],"filename=",n)==0 ){ |
| 797 | 782 | char *z = azArg[++i]; |
| 798 | | - if( zName && z && cgi_char_allowed(zName[0]) ){ |
| 783 | + if( zName && z && fossil_islower(zName[0]) ){ |
| 799 | 784 | cgi_set_parameter_nocopy(mprintf("%s:filename",zName), z, 1); |
| 800 | 785 | } |
| 801 | 786 | showBytes = 1; |
| 802 | 787 | }else if( c=='c' && sqlite3_strnicmp(azArg[i],"content-type:",n)==0 ){ |
| 803 | 788 | char *z = azArg[++i]; |
| 804 | | - if( zName && z && cgi_char_allowed(zName[0]) ){ |
| 789 | + if( zName && z && fossil_islower(zName[0]) ){ |
| 805 | 790 | cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1); |
| 806 | 791 | } |
| 807 | 792 | } |
| 808 | 793 | } |
| 809 | 794 | } |
| 810 | 795 | |