diff --git a/expat/xmltok/xmltok_impl.c b/expat/xmltok/xmltok_impl.c index 0361b261..8f8ffc44 100755 --- a/expat/xmltok/xmltok_impl.c +++ b/expat/xmltok/xmltok_impl.c @@ -1164,6 +1164,11 @@ int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, case BT_QUEST: case BT_CR: case BT_LF: + case BT_SEMI: + case BT_EXCL: + case BT_AST: + case BT_PERCNT: + case BT_NUM: break; case BT_S: if (CHAR_MATCHES(enc, ptr, '\t')) { @@ -1173,12 +1178,18 @@ int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, break; case BT_NAME: case BT_NMSTRT: - if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f) - && !CHAR_MATCHES(enc, ptr, '_')) + if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) break; default: - *badPtr = ptr; - return 0; + switch (BYTE_TO_ASCII(enc, ptr)) { + case 0x24: /* $ */ + case 0x40: /* @ */ + break; + default: + *badPtr = ptr; + return 0; + } + break; } } return 1;