From 64e364f48cf0fb4751f8d4e0138b631b05a6c224 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sun, 22 Mar 2015 19:48:56 +0300 Subject: [PATCH] Replace reserved characters when make filename to save article --- mainwindow.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mainwindow.cc b/mainwindow.cc index a2008785..0c23c27e 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -3224,7 +3224,12 @@ void MainWindow::on_saveArticle_triggered() { ArticleView *view = getCurrentArticleView(); - QString fileName = view->getTitle() + ".html"; + QString fileName = view->getTitle(); + + // Replace reserved filename characters + fileName.replace( QRegExp( "[/\\\\\\?\\*:\\|<>]" ), "_" ); + + fileName += ".html"; QString savePath; if ( cfg.articleSavePath.isEmpty() )