diff options
Diffstat (limited to 'modules/webcpanel/template_fileserver.cpp')
-rw-r--r-- | modules/webcpanel/template_fileserver.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/modules/webcpanel/template_fileserver.cpp b/modules/webcpanel/template_fileserver.cpp index 7436265d1..81c4c4a5f 100644 --- a/modules/webcpanel/template_fileserver.cpp +++ b/modules/webcpanel/template_fileserver.cpp @@ -1,8 +1,20 @@ /* - * (C) 2003-2016 Anope Team - * Contact us at team@anope.org + * Anope IRC Services * - * Please read COPYING and README for further details. + * Copyright (C) 2012-2016 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. */ #include "webcpanel.h" @@ -79,7 +91,7 @@ static Anope::string FindReplacement(const TemplateFileServer::Replacements &r, } } } - + TemplateFileServer::Replacements::const_iterator it = r.find(key); if (it != r.end()) return it->second; @@ -110,7 +122,7 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n buffer[i] = 0; buf += buffer; } - + close(fd); Anope::string finished; @@ -235,7 +247,7 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n // If the if stack is empty or we are in a true statement bool ifok = IfStack.empty() || IfStack.top(); bool forok = ForLoop::Stack.empty() || !ForLoop::Stack.back().finished(r); - + if (ifok && forok) { const Anope::string &replacement = FindReplacement(r, content.substr(0, f - 1)); @@ -252,7 +264,7 @@ void TemplateFileServer::Serve(HTTPProvider *server, const Anope::string &page_n // If the if stack is empty or we are in a true statement bool ifok = IfStack.empty() || IfStack.top(); bool forok = ForLoop::Stack.empty() || !ForLoop::Stack.back().finished(r); - + if (ifok && forok) finished += buf[j]; } |