Skip to content

Commit bfa6da9

Browse files
committed
[auth][bugfix] Do not expand authentication URI in browser items
This fixes an internally reported bug that affects all versions >= 2.18. The bug was caused by too early expansion of the credentials in the URI. Needs backporting.
1 parent 7fbecd3 commit bfa6da9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/providers/wfs/qgswfsdataitems.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ QgsWfsLayerItem::QgsWfsLayerItem( QgsDataItem *parent, QString name, const QgsDa
4646
{
4747
QgsSettings settings;
4848
bool useCurrentViewExtent = settings.value( QStringLiteral( "Windows/WFSSourceSelect/FeatureCurrentViewExtent" ), true ).toBool();
49-
mUri = QgsWFSDataSourceURI::build( uri.uri(), featureType, crsString, QString(), useCurrentViewExtent );
49+
mUri = QgsWFSDataSourceURI::build( uri.uri( false ), featureType, crsString, QString(), useCurrentViewExtent );
5050
setState( Populated );
5151
mIconName = QStringLiteral( "mIconConnect.png" );
5252
mBaseUri = uri.param( QStringLiteral( "url" ) );
@@ -278,7 +278,7 @@ void QgsWfsRootItem::newConnection()
278278

279279
QgsDataItem *QgsWfsDataItemProvider::createDataItem( const QString &path, QgsDataItem *parentItem )
280280
{
281-
QgsDebugMsg( "thePath = " + path );
281+
QgsDebugMsgLevel( "WFS path = " + path, 4 );
282282
if ( path.isEmpty() )
283283
{
284284
return new QgsWfsRootItem( parentItem, QStringLiteral( "WFS" ), QStringLiteral( "wfs:" ) );
@@ -291,7 +291,7 @@ QgsDataItem *QgsWfsDataItemProvider::createDataItem( const QString &path, QgsDat
291291
if ( QgsWfsConnection::connectionList().contains( connectionName ) )
292292
{
293293
QgsWfsConnection connection( connectionName );
294-
return new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, connection.uri().uri() );
294+
return new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, connection.uri().uri( false ) );
295295
}
296296
}
297297
else if ( path.startsWith( QLatin1String( "geonode:/" ) ) )
@@ -308,7 +308,7 @@ QgsDataItem *QgsWfsDataItemProvider::createDataItem( const QString &path, QgsDat
308308

309309
QgsDebugMsg( QString( "WFS full uri: '%1'." ).arg( QString( sourceUri.uri() ) ) );
310310

311-
return new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, sourceUri.uri() );
311+
return new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, sourceUri.uri( false ) );
312312
}
313313
}
314314

@@ -335,9 +335,9 @@ QVector<QgsDataItem *> QgsWfsDataItemProvider::createDataItems( const QString &p
335335
for ( const QString &encodedUri : encodedUris )
336336
{
337337
QgsWFSDataSourceURI uri( encodedUri );
338-
QgsDebugMsg( QStringLiteral( "WFS full uri: '%1'." ).arg( uri.uri() ) );
338+
QgsDebugMsg( QStringLiteral( "WFS full uri: '%1'." ).arg( uri.uri( false ) ) );
339339

340-
QgsDataItem *item = new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, uri.uri() );
340+
QgsDataItem *item = new QgsWfsConnectionItem( parentItem, QStringLiteral( "WFS" ), path, uri.uri( false ) );
341341
if ( item )
342342
{
343343
items.append( item );

0 commit comments

Comments
 (0)