fixed scoping for local on for tag.
This commit is contained in:
1 parent
f3b66d9770
commit
9a9abab92d
17 files changed
+751
-233
No files matched your search
+29
-29
@@ -33,33 +33,34 @@ namespace jet {
|
||||
sessions.erase(sessionId);
|
||||
}
|
||||
|
||||
coreutils::MString& Global::processModifier(coreutils::MString &value, coreutils::MString &modifier) {
|
||||
if(modifier.getLength() == 0)
|
||||
coreutils::MString Global::processModifier(coreutils::MString &value, coreutils::MString &modifier) {
|
||||
if(modifier == "")
|
||||
return value;
|
||||
std::cout << "mod: " << modifier << std::endl;
|
||||
if(modifier == "tobinary")
|
||||
modifiers.processToBinaryModifier(value, lastConverted);
|
||||
if(modifier == "frombinary")
|
||||
modifiers.processFromBinaryModifier(value, lastConverted);
|
||||
if(modifier == "tohex")
|
||||
modifiers.processToHexModifier(value, lastConverted);
|
||||
if(modifier == "fromhex")
|
||||
modifiers.processFromHexModifier(value, lastConverted);
|
||||
if(modifier == "tobase64")
|
||||
modifiers.processToBase64Modifier(value, lastConverted);
|
||||
if(modifier == "frombase64")
|
||||
modifiers.processFromBase64Modifier(value, lastConverted);
|
||||
if(modifier == "toupper")
|
||||
modifiers.processToUpperModifier(value, lastConverted);
|
||||
if(modifier == "tolower")
|
||||
modifiers.processToLowerModifier(value, lastConverted);
|
||||
if(modifier == "tocgi")
|
||||
modifiers.processToCGIModifier(value, lastConverted);
|
||||
if(modifier == "fromcgi")
|
||||
modifiers.processFromCGIModifier(value, lastConverted);
|
||||
return lastConverted;
|
||||
return value.toBinary();
|
||||
else if(modifier == "frombinary")
|
||||
return value.fromBinary();
|
||||
else if(modifier == "tohex")
|
||||
return value.toHex();
|
||||
else if(modifier == "fromhex")
|
||||
return value.fromHex();
|
||||
else if(modifier == "tobase64")
|
||||
return value.toBase64();
|
||||
else if(modifier == "frombase64")
|
||||
return value.fromBase64();
|
||||
else if(modifier == "toupper")
|
||||
return value.toUpper();
|
||||
else if(modifier == "tolower")
|
||||
return value.toLower();
|
||||
else if(modifier == "tocgi")
|
||||
return value.toCGI();
|
||||
else if(modifier == "fromcgi")
|
||||
return value.fromCGI();
|
||||
throw coreutils::Exception("modifier not valid.");
|
||||
}
|
||||
|
||||
coreutils::ZString Global::getVariable(coreutils::ZString &variable, std::map<coreutils::MString, coreutils::MString> &lvariables) {
|
||||
coreutils::MString Global::getVariable(coreutils::ZString &variable, std::map<coreutils::MString, coreutils::MString> &lvariables) {
|
||||
if(variable.ifNext("$[")) {
|
||||
coreutils::MString name;
|
||||
coreutils::MString modifier;
|
||||
@@ -107,9 +108,9 @@ namespace jet {
|
||||
return;
|
||||
} else if(variable.ifNext(":")) {
|
||||
name << ":";
|
||||
} else if(variable.startsWith("$[") || variable.startsWith("#["))
|
||||
name << getVariable(variable, lvariables);
|
||||
else if(variable.ifNext("]"))
|
||||
} else if(variable.startsWith("$[") || variable.startsWith("#[")) {
|
||||
name << getVariable(variable, lvariables);
|
||||
} else if(variable.ifNext("]"))
|
||||
return;
|
||||
else if(!variable.ifNextInclude("#?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-"))
|
||||
throw coreutils::Exception("invalid variable name.");
|
||||
@@ -184,9 +185,8 @@ namespace jet {
|
||||
do {
|
||||
namex = "";
|
||||
namex << name << ":" << index++;
|
||||
} while(cgiVariables.count(namex) != 0);
|
||||
modifiers.processFromCGIModifier(data, lastConverted);
|
||||
cgiVariables[namex] = lastConverted;
|
||||
} while(cgiVariables.count(namex) != 0);
|
||||
cgiVariables[namex] = data.fromCGI();
|
||||
} else
|
||||
throw coreutils::Exception("expecting = after name in received CGI data.");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user