Skip to content

Commit

Permalink
fix php too
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Dec 16, 2024
1 parent 70bf05c commit cdaab36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions std/php/_std/haxe/xml/Parser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ class Parser {
p += 8;
state = S.DOCTYPE;
start = p + 1;
} else if (str.fastCodeAt(p + 1) != '-'.code || str.fastCodeAt(p + 2) != '-'.code)
throw new XmlParserException("Expected <!--", str, p);
else {
} else if (str.fastCodeAt(p + 1) != '-'.code || str.fastCodeAt(p + 2) != '-'.code) throw new XmlParserException("Expected <!--",
str, p); else {
p += 2;
state = S.COMMENT;
start = p + 1;
Expand Down Expand Up @@ -362,8 +361,10 @@ class Parser {
if (parent.nodeType == Element) {
throw new XmlParserException("Unclosed node <" + parent.nodeName + ">", str, p);
}
if (p != start || nsubs == 0) {
if (p != start)
buf = buf.addSub(str, start, p - start);
var str = buf.toString();
if (str.length > 0 || nsubs == 0) {
addChild(Xml.createPCData(buf));
}
return p;
Expand Down

0 comments on commit cdaab36

Please sign in to comment.