Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hmm, previous regex was broken and relied on non-standard QRegExp res…
…ults...
  • Loading branch information
nyalldawson committed Apr 1, 2021
1 parent b53f97b commit a5d1156
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfscapabilities.cpp
Expand Up @@ -658,13 +658,13 @@ void QgsWfsCapabilities::capabilitiesReplyFinished()

QString QgsWfsCapabilities::NormalizeSRSName( QString crsName )
{
const QRegularExpression re( QRegularExpression::anchoredPattern( QStringLiteral( "urn:ogc:def:crs:([^:]+).+([^:]+)" ) ), QRegularExpression::CaseInsensitiveOption );
const QRegularExpression re( QRegularExpression::anchoredPattern( QStringLiteral( "urn:ogc:def:crs:([^:]+).+?([^:]+)" ) ), QRegularExpression::CaseInsensitiveOption );
if ( const QRegularExpressionMatch match = re.match( crsName ); match.hasMatch() )
{
return match.captured( 1 ) + ':' + match.captured( 2 );
}
// urn:x-ogc:def:crs:EPSG:xxxx as returned by http://maps.warwickshire.gov.uk/gs/ows? in WFS 1.1
const QRegularExpression re2( QRegularExpression::anchoredPattern( QStringLiteral( "urn:x-ogc:def:crs:([^:]+).+([^:]+)" ) ), QRegularExpression::CaseInsensitiveOption );
const QRegularExpression re2( QRegularExpression::anchoredPattern( QStringLiteral( "urn:x-ogc:def:crs:([^:]+).+?([^:]+)" ) ), QRegularExpression::CaseInsensitiveOption );
if ( const QRegularExpressionMatch match = re2.match( crsName ); match.hasMatch() )
{
return match.captured( 1 ) + ':' + match.captured( 2 );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfscapabilities.h
Expand Up @@ -152,7 +152,7 @@ class QgsWfsCapabilities : public QgsWfsRequest

void parseFilterCapabilities( const QDomElement &filterCapabilitiesElem );

static QString NormalizeSRSName( QString crsName );
static QString NormalizeSRSName( const QString &crsName );
};

#endif // QGSWFSCAPABILITIES_H

0 comments on commit a5d1156

Please sign in to comment.