Skip to content
Permalink
Browse files

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 a5d115624ea1cdce38c2d5e6dd437953b67e9f99
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/providers/wfs/qgswfscapabilities.cpp
  2. +1 −1 src/providers/wfs/qgswfscapabilities.h
@@ -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 );
@@ -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.