Fix Bug 391594 - Explicitly setting 'Content-Type' header causes crash

FIXED-IN: 5.8.0

BUG: 391594
wilder-work
Laurent Montel 8 years ago
parent 9580bb34e7
commit d1a0dc7784
  1. 9
      src/configuredialog/configurecomposerpage.cpp

@ -1078,9 +1078,14 @@ void ComposerPage::HeadersTab::save()
const int numberOfEntry = mHeaderList->topLevelItemCount();
for (int i = 0; i < numberOfEntry; ++i) {
item = mHeaderList->topLevelItem(i);
if (!item->text(0).isEmpty()) {
const QString str = item->text(0).trimmed();
if (!str.isEmpty()) {
if (str == QLatin1String("Content-Type")) {
KMessageBox::error(this, i18n("\'Content-Type\' is not an authorized string. This header will be not saved."), i18n("Invalid header"));
continue;
}
KConfigGroup config(KMKernel::self()->config(), QStringLiteral("Mime #%1").arg(numValidEntries));
config.writeEntry("name", item->text(0));
config.writeEntry("name", str);
config.writeEntry("value", item->text(1));
numValidEntries++;
}

Loading…
Cancel
Save