Commit
Line breaks are not properly handled in GeoJSON results when making GetFeature requests. Line breaks should be replaced by \\n.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( "\\\"" ) ) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rldhont
Author
Contributor
|
||
.replace( QString( "\r" ), QString( "\\r" ) ) | ||
.replace( QString( "\n" ), QString( "\\n" ) ); | ||
fStr += "\""; | ||
} | ||
fStr += "\n"; | ||
|
6 comments
on commit 016f497
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also run "scripts/prepare-commit.sh" (it can also directly be linked to .git/hooks/pre-commit) - and include "fix #ticket" or "fixes #ticket" in the commit message so that redmine picks it up automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jef-n I thought there is a conflict between redmine and github about "fix #ticket".
I think this string will close a github issue or pull-request and the good redmine issue. am I wrong ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. fix #xxx closes the redmine issue. I doubt there is a (enabled) automation for closing github issues (which we currently don't use for qgis anyway) or PRs. But the github web interface still mistakes #xxx in commits as links to PRs - but that's harmless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use 'fixes #xxxx' to close github issues in my other projects, but there is also fix, fixed, closes, close, closed, resolve, resolves, resolved https://help.github.com/articles/closing-issues-via-commit-messages/ . I don't know if we can deactivate its
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we use "fixes #xxxx" to close redmine issues (I think also Fix,implements - would have to look it up in redmine). See all over the commit log. I didn't hear from anyone that something else was closed by those - so I suppose it is not activated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll do it.
Please use replace( '\n',... ) instead. The single quote character methods are MUCH faster than the Qstring versions.