Skip to content

Commit

Permalink
[BUGFIX] 13118 QGIS Server - WFS - GeoJSON and escaping line breaks
Browse files Browse the repository at this point in the history
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 5471d66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/qgswfsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 5471d66

Please sign in to comment.