GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ModSecurity/src/run_time_string.cc at v3/master · witcheng/ModSecurity Expand file tree/ Copy pathrun_time_string.ccMore file actions 75 lines (60 loc) · 2.04 KB / Copy pathrun_time_string.ccFile metadata and controls75 lines (60 loc) · 2.04 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 /* * ModSecurity, http://www.modsecurity.org/ * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * If any of the files related to licensing are missing or if you have any * other questions related to licensing please contact Trustwave Holdings, Inc. * directly using the email address [email protected]. * */ #include <memory> #include "src/run_time_string.h" #include "modsecurity/variable_value.h" #include "modsecurity/transaction.h" #include "src/variables/rule.h" #include "src/variables/tx.h" #include "src/variables/highest_severity.h" #include "src/utils/string.h" #include "src/variables/variable.h" namespace modsecurity { void RunTimeString::appendText(const std::string &text) { std::unique_ptr<RunTimeElementHolder> r(new RunTimeElementHolder); r->m_string = text; m_elements.push_back(std::move(r)); } void RunTimeString::appendVar( std::unique_ptr<modsecurity::variables::Variable> var) { std::unique_ptr<RunTimeElementHolder> r(new RunTimeElementHolder); r->m_var = std::move(var); m_elements.push_back(std::move(r)); m_containsMacro = true; } std::string RunTimeString::evaluate(Transaction *t) { return evaluate(t, NULL); } std::string RunTimeString::evaluate(Transaction *t, Rule *r) { std::string s; for (auto &z : m_elements) { if (z->m_string.size() > 0) { s.append(z->m_string); } else if (z->m_var != NULL && t != NULL) { std::vector<const VariableValue *> l; // FIXME: This cast should be removed. RuleWithOperator *rr = dynamic_cast<RuleWithOperator *>(r); z->m_var->evaluate(t, rr, &l); if (l.size() > 0) { s.append(l[0]->getValue()); } for (auto &i : l) { delete i; } } } return s; } } // namespace modsecurity |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |