Skip to content

Commit 6daf48e

Browse files
alexbruynyalldawson
authored andcommittedSep 22, 2023
use stringToSafeFilename()
1 parent a3ca16e commit 6daf48e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/analysis/processing/qgsalgorithmsplitvectorlayer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsalgorithmsplitvectorlayer.h"
1919
#include "qgsvectorfilewriter.h"
2020
#include "qgsvariantutils.h"
21+
#include "qgsfileutils.h"
2122

2223
///@cond PRIVATE
2324

@@ -139,9 +140,7 @@ QVariantMap QgsSplitVectorLayerAlgorithm::processAlgorithm( const QVariantMap &p
139140
}
140141
else
141142
{
142-
QString value = ( *it ).toString();
143-
value.replace( QRegularExpression( "<|>|\\:|\\\\|\\/|\\||\\?|\\*|\"" ), QStringLiteral( "_" ) );
144-
fileName = QStringLiteral( "%1%2.%3" ).arg( baseName ).arg( value ).arg( outputFormat );
143+
fileName = QStringLiteral( "%1%2.%3" ).arg( baseName ).arg( QgsFileUtils::stringToSafeFilename( ( *it ).toString() ) ).arg( outputFormat );
145144
}
146145
feedback->pushInfo( QObject::tr( "Creating layer: %1" ).arg( fileName ) );
147146

0 commit comments

Comments
 (0)
Please sign in to comment.