Kaydet (Commit) 84017530 authored tarafından Eike Rathke's avatar Eike Rathke

properly check for ICU status so known tags get actually recognized

nIcuErr after the second RegexMatcher::find() call was
U_STRING_NOT_TERMINATED_WARNING hence a check for U_ZERO_ERROR failed
and a content string of "foo <emph>bar</emph> baz" became
"foo <emph>bar&lt;/emph&gt; baz" which later provoked a missing ending
tag error.

This should had used U_SUCCESS(nIcuErr) instead and only worked by
chance. Apparently the warning wasn't issued in earlier ICU versions and
only introduced with 55 or 56.

Change-Id: I36482c928544fc6e8c0403997af33084a47d4bea
üst 9bfe1d13
...@@ -1124,7 +1124,7 @@ OString XMLUtil::QuotHTML( const OString &rString ) ...@@ -1124,7 +1124,7 @@ OString XMLUtil::QuotHTML( const OString &rString )
icu::UnicodeString sReturn; icu::UnicodeString sReturn;
int32_t nEndPos = 0; int32_t nEndPos = 0;
int32_t nStartPos = 0; int32_t nStartPos = 0;
while( aRegexMatcher.find(nStartPos, nIcuErr) && nIcuErr == U_ZERO_ERROR ) while( aRegexMatcher.find(nStartPos, nIcuErr) && U_SUCCESS(nIcuErr) )
{ {
nStartPos = aRegexMatcher.start(nIcuErr); nStartPos = aRegexMatcher.start(nIcuErr);
if ( nEndPos < nStartPos ) if ( nEndPos < nStartPos )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment