multipart/formdata now works for cgi variables. Created base for dump tag.
This commit is contained in:
1 parent
c21dea1411
commit
c90c7353c7
6 files changed
+43
-132
No files matched your search
+16
-5
@@ -73,7 +73,11 @@ namespace jet {
|
||||
renderVariableName(variable, name, modifier, lvariables);
|
||||
return variables[name];
|
||||
} if(variable.ifNext(":")) {
|
||||
// TODO: should only allow CGI variable name. Allow variable substitution.
|
||||
renderVariableName(variable, name, modifier, lvariables);
|
||||
if(name.find(":") == -1) {
|
||||
name << ":0";
|
||||
}
|
||||
return processModifier(cgiVariables[name], modifier);
|
||||
} if(variable.ifNext("@")) {
|
||||
// TODO: should only allow session variables. Allow substitution.
|
||||
} if(variable.ifNext("%")) {
|
||||
@@ -103,8 +107,9 @@ namespace jet {
|
||||
if(variable.ifNext(";")) {
|
||||
renderVariableName(variable, modifier, modifier, lvariables);
|
||||
return;
|
||||
}
|
||||
else if(variable.startsWith("$[") || variable.startsWith("#["))
|
||||
} else if(variable.ifNext(":")) {
|
||||
name << ":";
|
||||
} else if(variable.startsWith("$[") || variable.startsWith("#["))
|
||||
name << getVariable(variable, lvariables);
|
||||
else if(variable.ifNext("]"))
|
||||
return;
|
||||
@@ -151,8 +156,14 @@ namespace jet {
|
||||
coreutils::ZString data = formdata.getTokenExclude("-"); // TODO: Fix this parsing. Need a string exclusion method to check for 'boundary'.
|
||||
data.trimCRLF();
|
||||
formdata.ifNext(boundary);
|
||||
cgiVariables[name] = data;
|
||||
std::cout << name << ":[" << data << "]" << std::endl;
|
||||
int index = 0;
|
||||
coreutils::MString namex;
|
||||
do {
|
||||
namex = "";
|
||||
namex << name << ":" << index++;
|
||||
} while(cgiVariables.count(namex) != 0);
|
||||
cgiVariables[namex] = data;
|
||||
// std::cout << namex << ":[" << data << "]" << std::endl;
|
||||
if(formdata.ifNext("--"))
|
||||
break;
|
||||
formdata.goeol();
|
||||
|
||||
Reference in new issue
Block a user