Skip to content

Commit 022f6cf

Browse files
authoredNov 9, 2017
Merge pull request #5515 from pblottiere/server_bugfix_plusspace
[server][bugfix] Fixes #17401 by replacing '+' symbol by space
2 parents b9bde10 + 7f37e70 commit 022f6cf

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

‎src/server/qgsserverrequest.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ QMap<QString, QString> QgsServerRequest::parameters() const
7979
QList<pair_t> items = query.queryItems( QUrl::FullyDecoded );
8080
Q_FOREACH ( const pair_t &pair, items )
8181
{
82-
mParams.insert( pair.first.toUpper(), pair.second );
82+
// prepare the value
83+
QString value = pair.second;
84+
value.replace( "+", " " );
85+
86+
mParams.insert( pair.first.toUpper(), value );
8387
}
8488
mDecoded = true;
8589
}

‎tests/src/python/test_qgsserver_wms.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ def test_getfeatureinfo(self):
207207
'FEATURE_COUNT=10&FILTER_GEOM=POLYGON((8.2035381 44.901459,8.2035562 44.901459,8.2035562 44.901418,8.2035381 44.901418,8.2035381 44.901459))',
208208
'wms_getfeatureinfo_invalid_query_layers')
209209

210+
# Test feature info request with '+' instead of ' ' in layers and
211+
# query_layers parameters
212+
self.wms_request_compare('GetFeatureInfo',
213+
'&layers=testlayer+%C3%A8%C3%A9&styles=&' +
214+
'info_format=text%2Fxml&transparent=true&' +
215+
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
216+
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
217+
'query_layers=testlayer+%C3%A8%C3%A9&X=190&Y=320',
218+
'wms_getfeatureinfo-text-xml')
219+
210220
def test_describelayer(self):
211221
# Test DescribeLayer
212222
self.wms_request_compare('DescribeLayer',

0 commit comments

Comments
 (0)
Please sign in to comment.