Browse Source

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

Simon Krajewski 10 years ago
parent
commit
3560c52adb
1 changed files with 2 additions and 0 deletions
  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);