fn injection_check(
    tags: &mut Tags,
    hca_keys: &HashMap<String, (SectionIdx, String)>,
    omit: &Omitted,
    test_xss: bool,
    test_sqli: bool,
) {
    for (value, (idx, name)) in hca_keys.iter() {
        let omit_tags = omit.exclusions.get(*idx).get(name);
        let rtest_xss = test_xss
            && !omit_tags
                .map(|tgs| LIBINJECTION_XSS_TAGS.intersection(tgs).next().is_some())
                .unwrap_or(false);
        let rtest_sqli = test_sqli
            && !omit_tags
                .map(|tgs| LIBINJECTION_SQLI_TAGS.intersection(tgs).next().is_some())
                .unwrap_or(false);
        if rtest_sqli {
            if let Some((b, _)) = sqli(value) {
                if b {
                    tags.insert_qualified("cf-rule-id", "libinjection-sqli");
                    tags.insert_qualified("cf-rule-category", "libinjection");
                    tags.insert_qualified("cf-rule-subcategory", "libinjection-sqli");
                    tags.insert_qualified("cf-rule-risk", "libinjection");
                }
            }
        }
        if rtest_xss {
            if let Some(b) = xss(value) {
                if b {
                    tags.insert_qualified("cf-rule-id", "libinjection-xss");
                    tags.insert_qualified("cf-rule-category", "libinjection");
                    tags.insert_qualified("cf-rule-subcategory", "libinjection-xss");
                    tags.insert_qualified("cf-rule-risk", "libinjection");
                }
            }
        }
    }
}
/// TODO: This also populates the hca_keys map
/// this is stupid and needs to be changed
This also populates the hca_keys map
this is stupid and needs to be changed
This also populates the hca_keys map this is stupid and needs to be changed
fn injection_check(
    tags: &mut Tags,
    hca_keys: &HashMap<String, (SectionIdx, String)>,
    omit: &Omitted,
    test_xss: bool,
    test_sqli: bool,
) {
    for (value, (idx, name)) in hca_keys.iter() {
        let omit_tags = omit.exclusions.get(*idx).get(name);
        let rtest_xss = test_xss
            && !omit_tags
                .map(|tgs| LIBINJECTION_XSS_TAGS.intersection(tgs).next().is_some())
                .unwrap_or(false);
        let rtest_sqli = test_sqli
            && !omit_tags
                .map(|tgs| LIBINJECTION_SQLI_TAGS.intersection(tgs).next().is_some())
                .unwrap_or(false);
        if rtest_sqli {
            if let Some((b, _)) = sqli(value) {
                if b {
                    tags.insert_qualified("cf-rule-id", "libinjection-sqli");
                    tags.insert_qualified("cf-rule-category", "libinjection");
                    tags.insert_qualified("cf-rule-subcategory", "libinjection-sqli");
                    tags.insert_qualified("cf-rule-risk", "libinjection");
                }
            }
        }
        if rtest_xss {
            if let Some(b) = xss(value) {
                if b {
                    tags.insert_qualified("cf-rule-id", "libinjection-xss");
                    tags.insert_qualified("cf-rule-category", "libinjection");
                    tags.insert_qualified("cf-rule-subcategory", "libinjection-xss");
                    tags.insert_qualified("cf-rule-risk", "libinjection");
                }
            }
        }
    }
}
fn injection_check ( tags : & mut Tags , hca_keys : & HashMap < String , ( SectionIdx , String ) > , omit : & Omitted , test_xss : bool , test_sqli : bool , ) { for ( value , ( idx , name ) ) in hca_keys . iter ( ) { let omit_tags = omit . exclusions . get ( * idx ) . get ( name ) ; let rtest_xss = test_xss && ! omit_tags . map ( | tgs | LIBINJECTION_XSS_TAGS . intersection ( tgs ) . next ( ) . is_some ( ) ) . unwrap_or ( false ) ; let rtest_sqli = test_sqli && ! omit_tags . map ( | tgs | LIBINJECTION_SQLI_TAGS . intersection ( tgs ) . next ( ) . is_some ( ) ) . unwrap_or ( false ) ; if rtest_sqli { if let Some ( ( b , _ ) ) = sqli ( value ) { if b { tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; } } } if rtest_xss { if let Some ( b ) = xss ( value ) { if b { tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; tags . insert_qualified ( " " , " " ) ; } } } } }
TODO: This also populates the hca_keys map
this is stupid and needs to be changed
TODO : This also populates the hca_keys map this is stupid and needs to be changed
tags
&mut Tags
hca_keys
&HashMap<String, (SectionIdx, String)>
omit
&Omitted
test_xss
bool
test_sqli
bool