summaryrefslogtreecommitdiff
path: root/modules/extra/webcpanel/template_fileserver.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
committerAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
commitd33a0f75a5c0c584fbb7cc0076da36d494f39494 (patch)
tree7b2274cc833c793c0f5595660cbd4d715de52ffd /modules/extra/webcpanel/template_fileserver.cpp
parent368d469631763e9c8bf399980d0ac7c5b5664d39 (diff)
Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each other
Diffstat (limited to 'modules/extra/webcpanel/template_fileserver.cpp')
-rw-r--r--modules/extra/webcpanel/template_fileserver.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/extra/webcpanel/template_fileserver.cpp b/modules/extra/webcpanel/template_fileserver.cpp
index b1881b811..cf7094e39 100644
--- a/modules/extra/webcpanel/template_fileserver.cpp
+++ b/modules/extra/webcpanel/template_fileserver.cpp
@@ -126,7 +126,8 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n
if (content.find("IF ") == 0)
{
- std::vector<Anope::string> tokens = BuildStringVector(content);
+ std::vector<Anope::string> tokens;
+ spacesepstream(content).GetTokens(tokens);
if (tokens.size() == 4 && tokens[1] == "EQ")
{
@@ -163,13 +164,17 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n
}
else if (content.find("FOR ") == 0)
{
- std::vector<Anope::string> tokens = BuildStringVector(content);
+ std::vector<Anope::string> tokens;
+ spacesepstream(content).GetTokens(tokens);
+
if (tokens.size() != 4 || tokens[2] != "IN")
Log() << "Invalid FOR in web template " << this->file_name;
else
{
- std::vector<Anope::string> temp_variables = BuildStringVector(tokens[1], ','),
- real_variables = BuildStringVector(tokens[3], ',');
+ std::vector<Anope::string> temp_variables, real_variables;
+ commasepstream(tokens[1]).GetTokens(temp_variables);
+ commasepstream(tokens[3]).GetTokens(real_variables);
+
if (temp_variables.size() != real_variables.size())
Log() << "Invalid FOR in web template " << this->file_name << " variable mismatch";
else
@@ -200,7 +205,9 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n
}
else if (content.find("INCLUDE ") == 0)
{
- std::vector<Anope::string> tokens = BuildStringVector(content);
+ std::vector<Anope::string> tokens;
+ spacesepstream(content).GetTokens(tokens);
+
if (tokens.size() != 2)
Log() << "Invalid INCLUDE in web template " << this->file_name;
else