class
Analyzer::Php::ThinkPHP
- Analyzer::Php::ThinkPHP
- Analyzer::Php::PhpEngine
- Analyzer
- Reference
- Object
Defined in:
analyzer/analyzers/php/thinkphp.crConstant Summary
-
ALL_METHODS =
["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"] -
BODY_POST_EVIDENCE_RE =
Regex.union(["->post(", "post.", "request()->post", "$_POST", "isPost"]) -
Precompiled once at load: five String#includes? scans of the whole method body OR'd together, replaced with a single Regex#matches? call (Crystal's String#includes? is measurably slower than a precompiled Regex).
-
INPUT_POST_EVIDENCE_RE =
Regex.union(["post.", "->post(", "request()->post"]) -
Precompiled once at load. Both of these used to be several
String#includes?scans of the (whole, unchanging)contextbuffer OR'd together, re-run once per regex match inside their enclosingcontext.scanloop below even thoughcontextnever changes within a singleextract_request_paramscall. Hoisting the check out of the loop and collapsing it into one precompiled Regex#matches? call turns an O(matches) full-buffer rescan into a single O(1) check per call. -
ONLY_POST_EVIDENCE_RE =
Regex.union(["post.", "->post(", "request()->post", "$_POST", "postMore"])