--- parser3/src/main/untaint.C 2001/09/14 15:41:59 1.62 +++ parser3/src/main/untaint.C 2001/10/08 08:52:45 1.65 @@ -2,10 +2,10 @@ Parser: String class part: untaint mechanizm. Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: untaint.C,v 1.65 2001/10/08 08:52:45 parser Exp $ */ -static const char *RCSId="$Id: untaint.C,v 1.62 2001/09/14 15:41:59 parser Exp $"; #include "pa_pool.h" #include "pa_string.h" @@ -159,6 +159,7 @@ char *String::store_to(char *dest, Untai Dictionary *typo_dict=user_typo_dict?user_typo_dict:default_typo_dict; bool whitespace=true; + bool need_to_close_http_header_quote=false; const Chunk *chunk=&head; do { const Chunk::Row *row=chunk->rows; @@ -237,7 +238,7 @@ char *String::store_to(char *dest, Untai case '\"': to_string("\\\"", 2); break; _default; }); - *dest++='\"'; + need_to_close_http_header_quote=true; } else { memcpy(dest, row->item.ptr, row->item.size); dest+=row->item.size; @@ -396,14 +397,19 @@ char *String::store_to(char *dest, Untai dest=dest_before_origins; else { for(char *p=dest_after_origins; plink; } while(chunk); + + if(need_to_close_http_header_quote) + *dest++='\"'; break2: return dest; }