Skip to content

Commit c09f5be

Browse files
committedJun 30, 2017
Safer filtering step thanks to QgsExpression
1 parent 6a1c141 commit c09f5be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/core/qgsvectorlayerjoinbuffer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ QgsFeature QgsVectorLayerJoinBuffer::joinedFeatureOf( const QgsVectorLayerJoinIn
419419
if ( info.joinLayer() )
420420
{
421421
const QVariant targetValue = feature.attribute( info.targetFieldName() );
422-
const QString filter = QString( "\"%1\" = %2" ).arg( info.joinFieldName(), targetValue.toString() );
422+
QString fieldRef = QgsExpression::quotedColumnRef( info.joinFieldName() );
423+
QString quotedVal = QgsExpression::quotedValue( targetValue.toString() );
424+
const QString filter = QString( "%1 = %2" ).arg( fieldRef, quotedVal );
423425

424426
QgsFeatureRequest request;
425427
request.setFilterExpression( filter );

0 commit comments

Comments
 (0)
Please sign in to comment.