From 93cb64e46fe3d33e4c7e1e70685f1b1421fb9514 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Mon, 26 Feb 2018 18:42:13 +0800 Subject: [PATCH] =?UTF-8?q?expr=5Fplus=E8=A1=A8=E7=9A=84district=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=94=AF=E6=8C=81=E8=BD=AC=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_rule.cpp | 3 ++- test/maat_json.json | 2 +- test/maat_test.cpp | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 80cdf57..3bc013f 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -30,7 +30,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_1_20180209=1; +int MAAT_FRAME_VERSION_2_1_20180226=1; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", "unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""}; @@ -1659,6 +1659,7 @@ int add_expr_rule(struct _Maat_table_info_t* table,struct db_str_rule_t* db_rule if(table->table_type==TABLE_TYPE_EXPR_PLUS) { assert(strlen(db_rule->district)>0); + str_unescape(db_rule->district); district_id=get_district_id(scanner, db_rule->district); } group_rule=(struct _Maat_group_inner_t*)HASH_fetch_by_id(scanner->group_hash, db_rule->group_id); diff --git a/test/maat_json.json b/test/maat_json.json index 1203835..9a72419 100644 --- a/test/maat_json.json +++ b/test/maat_json.json @@ -205,7 +205,7 @@ "table_name": "HTTP_REGION", "table_type": "expr_plus", "table_content": { - "district": "URL", + "district": "HTTP\\bURL", "keywords": "abckkk&123", "expr_type": "and", "match_method": "sub", diff --git a/test/maat_test.cpp b/test/maat_test.cpp index 3121e57..775ef42 100644 --- a/test/maat_test.cpp +++ b/test/maat_test.cpp @@ -424,7 +424,7 @@ int test_expr_plus(Maat_feather_t feather,const char* table_name,scan_status_t* int table_id=0; struct Maat_rule_t result[4]; int found_pos[4]; - const char* region_name="URL"; + const char* region_name="HTTP URL"; const char* scan_data="http://www.cyberessays.com/search_results.php?action=search&query=yulingjing,abckkk,1234567"; table_id=Maat_table_register(feather,table_name); if(table_id==-1) @@ -453,6 +453,10 @@ int test_expr_plus(Maat_feather_t feather,const char* table_name,scan_status_t* { printf("Hit expr_plus rule %d.\n",result[0].config_id); } + else + { + printf("Test expr_plus failed.\n"); + } return ret; }