Skip to content

Commit

Permalink
Sanitize usage of static regex
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 23, 2020
1 parent 9e0bf6d commit fc8430f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsprojutils.cpp
Expand Up @@ -257,9 +257,10 @@ bool QgsProjUtils::coordinateOperationIsAvailable( const QString &projDef )
QList<QgsDatumTransform::GridDetails> QgsProjUtils::gridsUsed( const QString &proj )
{
static QRegularExpression sRegex( QStringLiteral( "\\+(?:nad)?grids=(.*?)\\s" ) );
QRegularExpression regex( sRegex );

QList< QgsDatumTransform::GridDetails > grids;
QRegularExpressionMatchIterator matches = sRegex.globalMatch( proj );
QRegularExpressionMatchIterator matches = regex.globalMatch( proj );
while ( matches.hasNext() )
{
const QRegularExpressionMatch match = matches.next();
Expand Down

0 comments on commit fc8430f

Please sign in to comment.