Skip to content
Permalink
Browse files

[BUGFIX] 13118 QGIS Server - WFS - GeoJSON and escaping line breaks

Line breaks are not properly handled in GeoJSON results when making GetFeature requests.
Line breaks should be replaced by \\n.
  • Loading branch information
rldhont committed Nov 11, 2015
1 parent 17378ba commit 5471d66535752adbd3dc1c19e405455c28ffb7d5
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/qgswfsserver.cpp
@@ -1742,7 +1742,10 @@ QString QgsWFSServer::createFeatureGeoJSON( QgsFeature* feat, int prec, QgsCoord
else
{
fStr += "\"";
fStr += val.toString().replace( QString( "\"" ), QString( "\\\"" ) );
fStr += val.toString()
.replace( QString( "\"" ), QString( "\\\"" ) )
.replace( QString( "\r" ), QString( "\\r" ) )
.replace( QString( "\n" ), QString( "\\n" ) );
fStr += "\"";
}
fStr += "\n";

0 comments on commit 5471d66

Please sign in to comment.
You can’t perform that action at this time.