From e256481bce36136e683c6530f873aaf9aa04380a Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Tue, 21 Jul 1998 20:38:27 +0000 Subject: [PATCH] fix 241429 git-svn-id: svn://10.0.0.236/trunk@6101 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/libparse/pa_amp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mozilla/lib/libparse/pa_amp.c b/mozilla/lib/libparse/pa_amp.c index 35677b27c39..de52a93ab34 100644 --- a/mozilla/lib/libparse/pa_amp.c +++ b/mozilla/lib/libparse/pa_amp.c @@ -453,10 +453,22 @@ pa_map_escape(char *buf, int32 len, int32 *esc_len, unsigned char *out, * Only match a prefix if the next * character is NOT an alphanumeric */ - if ((!XP_IS_ALPHA(*(buf + - PA_Name2Unicode[cnt].len)))&& - (!XP_IS_DIGIT(*(buf + - PA_Name2Unicode[cnt].len)))) + /* + * The following bug have been related to the following line + * bug 241429, 57959, 33262, 57912 if you work on this. + * After we add HTML 4.0 entity table we change the algorithm to prevent + * &part= be treat as name entity. + * The algorithm is as following: + * If the unicode value is in the Latin 1 range + * We mantain the SGML compliant + * otherwise + * We only treat it as name entity if it start from & and end with a ; + */ + if(((PA_Name2Unicode[cnt].unicode <= 256) && + (!XP_IS_ALPHA(*(buf + PA_Name2Unicode[cnt].len))) && + (!XP_IS_DIGIT(*(buf + PA_Name2Unicode[cnt].len))) + ) || (';' == (*(buf + PA_Name2Unicode[cnt].len))) + ) { unicode = PA_Name2Unicode[cnt].unicode; *esc_len = PA_Name2Unicode[cnt].len;