mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
loader/svg: Skip check for quotes inside quotes
Single or double quotation marks that occur before closing the quotation mark are ignored.
This commit is contained in:
parent
80fa5fca22
commit
2726eb8baa
1 changed files with 4 additions and 3 deletions
|
@ -171,10 +171,11 @@ static const char* _simpleXmlFindStartTag(const char* itr, const char* itrEnd)
|
|||
|
||||
static const char* _simpleXmlFindEndTag(const char* itr, const char* itrEnd)
|
||||
{
|
||||
bool insideQuote = false;
|
||||
bool insideQuote[2] = {false, false}; // 0: ", 1: '
|
||||
for (; itr < itrEnd; itr++) {
|
||||
if (*itr == '"') insideQuote = !insideQuote;
|
||||
if (!insideQuote) {
|
||||
if (*itr == '"' && !insideQuote[1]) insideQuote[0] = !insideQuote[0];
|
||||
if (*itr == '\'' && !insideQuote[0]) insideQuote[1] = !insideQuote[1];
|
||||
if (!insideQuote[0] && !insideQuote[1]) {
|
||||
if ((*itr == '>') || (*itr == '<'))
|
||||
return itr;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue