Skip to content
Permalink
Browse files

Safer filtering step thanks to QgsExpression

  • Loading branch information
pblottiere committed Jun 30, 2017
1 parent 6a1c141 commit c09f5bef8370a9d17c090aeb98cfce3cae6a2c26
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/qgsvectorlayerjoinbuffer.cpp
@@ -419,7 +419,9 @@ QgsFeature QgsVectorLayerJoinBuffer::joinedFeatureOf( const QgsVectorLayerJoinIn
if ( info.joinLayer() )
{
const QVariant targetValue = feature.attribute( info.targetFieldName() );
const QString filter = QString( "\"%1\" = %2" ).arg( info.joinFieldName(), targetValue.toString() );
QString fieldRef = QgsExpression::quotedColumnRef( info.joinFieldName() );
QString quotedVal = QgsExpression::quotedValue( targetValue.toString() );
const QString filter = QString( "%1 = %2" ).arg( fieldRef, quotedVal );

QgsFeatureRequest request;
request.setFilterExpression( filter );

0 comments on commit c09f5be

Please sign in to comment.
You can’t perform that action at this time.