Skip to content

Commit 9c89965

Browse files
committedDec 8, 2011
WMS server: let fuzzy string functions go through filter safety test
1 parent 94984a3 commit 9c89965

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/mapserver/qgswmsserver.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ QImage* QgsWMSServer::getMap()
581581
restoreLayerFilters( originalLayerFilters );
582582
clearFeatureSelections( selectedLayerIdList );
583583

584-
QgsDebugMsg("clearing filters");
584+
QgsDebugMsg( "clearing filters" );
585585
QgsMapLayerRegistry::instance()->mapLayers().clear();
586586

587587
#ifdef QGISDEBUG
@@ -1700,7 +1700,7 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi
17001700
throw QgsMapServiceException( "Filter string rejected", "The filter string " + eqSplit.at( 1 ) +
17011701
" has been rejected because of security reasons. Note: Text strings have to be enclosed in single or double quotes. " +
17021702
"A space between each word / special character is mandatory. Allowed Keywords and special characters are " +
1703-
"AND,OR,IN,<,>=,>,>=,!=,',',(,). Not allowed are semicolons in the filter expression." );
1703+
"AND,OR,IN,<,>=,>,>=,!=,',',(,),DMETAPHONE,SOUNDEX. Not allowed are semicolons in the filter expression." );
17041704
}
17051705

17061706
//we need to find the maplayer objects matching the layer name
@@ -1832,7 +1832,9 @@ bool QgsWMSServer::testFilterStringSafety( const QString& filter ) const
18321832
|| tokenIt->compare( ">=" ) == 0
18331833
|| tokenIt->compare( "AND", Qt::CaseInsensitive ) == 0
18341834
|| tokenIt->compare( "OR", Qt::CaseInsensitive ) == 0
1835-
|| tokenIt->compare( "IN", Qt::CaseInsensitive ) == 0 )
1835+
|| tokenIt->compare( "IN", Qt::CaseInsensitive ) == 0
1836+
|| tokenIt->compare( "DMETAPHONE", Qt::CaseInsensitive ) == 0
1837+
|| tokenIt->compare( "SOUNDEX", Qt::CaseInsensitive ) == 0 )
18361838
{
18371839
continue;
18381840
}

0 commit comments

Comments
 (0)
Please sign in to comment.