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 0339f3f commit 84971466848d0a7527096c5c2f660465f9183b8f
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/qgswfsserver.cpp
@@ -1723,7 +1723,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 8497146

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