Skip to content

Commit

Permalink
Safer filtering step thanks to QgsExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jun 30, 2017
1 parent 6a1c141 commit c09f5be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/qgsvectorlayerjoinbuffer.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit c09f5be

Please sign in to comment.