Correcting bug with quote character in workout Textevents and ZWO export (#3872)

Add protection for all XML special characters in workout Textevents and ZWO export
This commit is contained in:
comediebenji
2021-04-18 23:22:34 +02:00
committed by GitHub
parent 696a04e8a0
commit 5d666c8233

View File

@@ -1520,12 +1520,14 @@ ErgFile::save(QStringList &errors)
<< "PowerHigh=\"" <<sections[i].end/CP << "\"";
if (Texts.count() > 0) {
out << ">\n";
foreach (ErgFileText cue, Texts)
if (cue.x >= msecs && cue.x <= msecs+sections[i].duration)
foreach (ErgFileText cue, Texts) {
if (cue.x >= msecs && cue.x <= msecs+sections[i].duration) {
out << " <textevent "
<< "timeoffset=\""<<(cue.x-msecs)/1000
<< "\" message=\"" << cue.text
<< "\" message=\"" << Utils::xmlprotect(cue.text)
<< "\" duration=\"" << cue.duration << "\"/>\n";
}
}
out << " </" << tag << ">\n";
} else {
out << "/>\n";