diff options
| author | 2010-08-08 11:21:40 -0400 | |
|---|---|---|
| committer | 2010-08-08 11:21:40 -0400 | |
| commit | a655c8ff5f9f16119bb49df320eb60bd6d386fa6 (patch) | |
| tree | 0791efc97cdc8e20c2ea3d10a1dce6b362835639 /src/configparser.cpp | |
| parent | Don't choke on XML self-closing tags like <connect allow="*" /> (diff) | |
| download | inspircd++-a655c8ff5f9f16119bb49df320eb60bd6d386fa6.tar.gz inspircd++-a655c8ff5f9f16119bb49df320eb60bd6d386fa6.tar.bz2 inspircd++-a655c8ff5f9f16119bb49df320eb60bd6d386fa6.zip | |
Ignore XML closing tags (</tag>) in case an XML generator is used to write configs
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 173c81338..182451dcb 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -169,6 +169,17 @@ struct Parser nextword(name); int spc = next(); + if (spc == '/' && name.empty()) + { + // XML close tag like "</tag>"; ignore. + nextword(name); + spc = next(); + if (spc != '>') + throw CoreException("Invalid characters in XML closing tag"); + return; + } + + // Except for <tag> and <tag/>, the name must be followed by a space if (spc == '>' || spc == '/') unget(spc); else if (!isspace(spc)) |
