[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.
This commit is contained in:
rldhont 2015-11-11 20:10:09 +01:00
parent b4d206af71
commit 016f497726

View File

@ -1751,7 +1751,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";