mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 12:37:03 +02:00
parser fixes
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
|
||||
#define PROGNAME "piler"
|
||||
|
||||
#define VERSION "0.1.12"
|
||||
#define VERSION "0.1.13"
|
||||
|
||||
#define PROGINFO VERSION ", Janos SUTO <sj@acts.hu>\n\n" CONFIGURE_PARAMS "\n"
|
||||
|
||||
|
@ -398,7 +398,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, stru
|
||||
|
||||
if(strncasecmp(puf, "http://", 7) == 0 || strncasecmp(puf, "https://", 8) == 0) fixURL(puf);
|
||||
|
||||
if(state->is_header == 0 && strncmp(puf, "URL*", 4) && (puf[0] == ' ' || strlen(puf) > MAX_WORD_LEN || isHexNumber(puf)) ) continue;
|
||||
if(state->is_header == 0 && strncmp(puf, "__URL__", 7) && (puf[0] == ' ' || strlen(puf) > MAX_WORD_LEN || isHexNumber(puf)) ) continue;
|
||||
|
||||
|
||||
len = strlen(puf);
|
||||
|
@ -496,7 +496,7 @@ void translateLine(unsigned char *p, struct _state *state){
|
||||
|
||||
void fix_email_address_for_sphinx(char *s){
|
||||
for(; *s; s++){
|
||||
if(*s == '@' || *s == '.' || *s == '+') *s = 'X';
|
||||
if(*s == '@' || *s == '.' || *s == '+' || *s == '-' || *s == '_') *s = 'X';
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,7 +589,7 @@ void fixURL(char *url){
|
||||
if(q) *q = '\0';
|
||||
|
||||
snprintf(fixed_url, sizeof(fixed_url)-1, "__URL__%s ", p);
|
||||
fix_email_address_for_sphinx(fixed_url);
|
||||
fix_email_address_for_sphinx(fixed_url+7);
|
||||
|
||||
strcpy(url, fixed_url);
|
||||
}
|
||||
|
@ -147,6 +147,8 @@ int check_attachment_rule(struct _state *state, struct rule *rule){
|
||||
int i;
|
||||
size_t nmatch=0;
|
||||
|
||||
if(state->n_attachments == 0) return 1;
|
||||
|
||||
for(i=1; i<=state->n_attachments; i++){
|
||||
if(
|
||||
regexec(&(rule->attachment_type), state->attachments[i].type, nmatch, NULL, 0) == 0 &&
|
||||
|
Reference in New Issue
Block a user