Skip to content

Commit

Permalink
Merge pull request #63 from esl/xml_compliance
Browse files Browse the repository at this point in the history
Verify forbidden chars inside cdata and escaped chars!
  • Loading branch information
arcusfelis authored Jun 1, 2022
2 parents ef7018f + cc1bdba commit 7dfbe38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions c_src/rapidxml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,7 @@ namespace rapidxml
}

// No replacement, only copy character
check_control<control_points_pred, Flags>(src);
*dest++ = *src++;

}
Expand Down
4 changes: 4 additions & 0 deletions test/exml_properties_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ vector_2_forbidden_control_char_test() ->
vector_3_forbidden_control_char_test() ->
?assertMatch({error, _}, exml:parse(<<"<body lang='en' bad='", 16#1B, "'></body>">>)).

vector_4_forbidden_control_char_test() ->
?assertMatch({error, _},
exml:parse(<<"<message to='alice@localhost'><body>&amp;lt;body&amp;gt;", 16#1B,"&amp;lt;/body&amp;gt;</body></body>">>)).

fail_forbidden_control_char_test() ->
p("All valid xml cdata can be parsed",
?FORALL(Doc, utf8_doc_bad(),
Expand Down

0 comments on commit 7dfbe38

Please sign in to comment.