Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #5515 from pblottiere/server_bugfix_plusspace
Browse files Browse the repository at this point in the history
[server][bugfix]  Fixes #17401 by replacing '+' symbol by space
  • Loading branch information
pblottiere committed Nov 9, 2017
2 parents b9bde10 + 7f37e70 commit 022f6cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/qgsserverrequest.cpp
Expand Up @@ -79,7 +79,11 @@ QMap<QString, QString> QgsServerRequest::parameters() const
QList<pair_t> items = query.queryItems( QUrl::FullyDecoded );
Q_FOREACH ( const pair_t &pair, items )
{
mParams.insert( pair.first.toUpper(), pair.second );
// prepare the value
QString value = pair.second;
value.replace( "+", " " );

mParams.insert( pair.first.toUpper(), value );
}
mDecoded = true;
}
Expand Down
10 changes: 10 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Expand Up @@ -207,6 +207,16 @@ def test_getfeatureinfo(self):
'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))',
'wms_getfeatureinfo_invalid_query_layers')

# Test feature info request with '+' instead of ' ' in layers and
# query_layers parameters
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer+%C3%A8%C3%A9&styles=&' +
'info_format=text%2Fxml&transparent=true&' +
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
'query_layers=testlayer+%C3%A8%C3%A9&X=190&Y=320',
'wms_getfeatureinfo-text-xml')

def test_describelayer(self):
# Test DescribeLayer
self.wms_request_compare('DescribeLayer',
Expand Down

0 comments on commit 022f6cf

Please sign in to comment.