浏览代码

catch invalid characters in entity escapes to avoid crazy errors 2000 lines later

Simon Krajewski 10 年之前
父节点
当前提交
3560c52adb
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/haxe/xml/Parser.hx

+ 2 - 0
std/haxe/xml/Parser.hx

@@ -329,6 +329,8 @@ class Parser
 						}
 						start = p + 1;
 						state = escapeNext;
+					} else if (!isValidChar(c)) {
+						throw 'Invalid character in entity: ' + String.fromCharCode(c);
 					}
 			}
 			c = str.fastCodeAt(++p);