Skip to content

Fixes 172: Sanitize tags when editing or creating a node - #177

Merged
stopflock merged 1 commit into
FoggedLens:mainfrom
reb1995:Fix-172-Sanitize-tags
Jul 17, 2026
Merged

Fixes 172: Sanitize tags when editing or creating a node#177
stopflock merged 1 commit into
FoggedLens:mainfrom
reb1995:Fix-172-Sanitize-tags

Conversation

@reb1995

@reb1995 reb1995 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Was able to replicate the error in #172.

[UploadQueue] Node operation failed (attempt 4): Failed to modify node: HTTP 400 - Cannot parse valid node from xml string         <osm>
          <node changeset="185871008" id="12663617731" version="3" lat="37.36582032009576" lon="-122.07795191049095">
            <tag k="camera:mount" v="pole"/>
            <tag k="camera:type" v="fixed"/>
            <tag k="man_made" v="surveillance"/>
            <tag k="manufacturer" v="Flock Safety"/>
            <tag k="manufacturer:wikidata" v="Q108485435"/>
            <tag k="surveillance" v="public"/>
            <tag k="surveillance:type" v="ALPR"/>
            <tag k="surveillance:zone" v="traffic"/>
            <tag k="wikimedia_commons" v="File:ALPR Los Altos Grant & Covington.jpg"/>
            <tag k="operator" v="Los Altos Police Department"/>
            <tag k="operator:wikidata" v="Q120751721"/>
            <tag k="direction" v="180"/>
          </node>
        </osm>. Fatal error: xmlParseEntityRef: no name at :11.

XML sanitization was previously only applied to user comments. This PR applies sanitization to tags as well. The current profiles don't include &s or free form texts boxes where users can add them, but if the & is added from the web or a custom profile, the node will be uneditable from the app.

This fixes that problem.

3 scenarios tested using OSM Sandbox. All passed.

  • Creating a new node with an "&" in a text box.
  • Editing a node to add a text box with "&"
  • Moving a node with a text box that has an "&"

@stopflock
stopflock merged commit b9110c1 into FoggedLens:main Jul 17, 2026
4 checks passed
@reb1995
reb1995 deleted the Fix-172-Sanitize-tags branch July 18, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants