mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Refactoring: Pass all the control over the variables to the Variables class
This commit is contained in:
@@ -44,42 +44,42 @@ bool GeoLookup::evaluate(Assay *assay, const std::string &exp) {
|
||||
}
|
||||
if (ret && gir) {
|
||||
if (gir->country_code) {
|
||||
assay->store_variable("GEO:COUNTRY_CODE", gir->country_code);
|
||||
assay->m_variables.store("GEO:COUNTRY_CODE", gir->country_code);
|
||||
}
|
||||
if (gir->country_code3) {
|
||||
assay->store_variable("GEO:COUNTRY_CODE3", gir->country_code3);
|
||||
assay->m_variables.store("GEO:COUNTRY_CODE3", gir->country_code3);
|
||||
}
|
||||
if (gir->country_name) {
|
||||
assay->store_variable("GEO:COUNTRY_NAME", gir->country_name);
|
||||
assay->m_variables.store("GEO:COUNTRY_NAME", gir->country_name);
|
||||
}
|
||||
if (gir->continent_code) {
|
||||
assay->store_variable("GEO:COUNTRY_CONTINENT",
|
||||
assay->m_variables.store("GEO:COUNTRY_CONTINENT",
|
||||
gir->continent_code);
|
||||
}
|
||||
if (gir->country_code && gir->region) {
|
||||
assay->store_variable("GEO:REGION",
|
||||
assay->m_variables.store("GEO:REGION",
|
||||
GeoIP_region_name_by_code(gir->country_code, gir->region));
|
||||
}
|
||||
if (gir->city) {
|
||||
assay->store_variable("GEO:CITY", gir->city);
|
||||
assay->m_variables.store("GEO:CITY", gir->city);
|
||||
}
|
||||
if (gir->postal_code) {
|
||||
assay->store_variable("GEO:POSTAL_CODE", gir->postal_code);
|
||||
assay->m_variables.store("GEO:POSTAL_CODE", gir->postal_code);
|
||||
}
|
||||
if (gir->latitude) {
|
||||
assay->store_variable("GEO:LATITUDE",
|
||||
assay->m_variables.store("GEO:LATITUDE",
|
||||
std::to_string(gir->latitude));
|
||||
}
|
||||
if (gir->longitude) {
|
||||
assay->store_variable("GEO:LONGITUDE",
|
||||
assay->m_variables.store("GEO:LONGITUDE",
|
||||
std::to_string(gir->longitude));
|
||||
}
|
||||
if (gir->metro_code) {
|
||||
assay->store_variable("GEO:DMA_CODE",
|
||||
assay->m_variables.store("GEO:DMA_CODE",
|
||||
std::to_string(gir->metro_code));
|
||||
}
|
||||
if (gir->area_code) {
|
||||
assay->store_variable("GEO:AREA_CODE",
|
||||
assay->m_variables.store("GEO:AREA_CODE",
|
||||
std::to_string(gir->area_code));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user