Skip to content

Escape street names for GPX properly #572

Closed

Description

@karussell

Streets can contain chars like < (intended or not) and therefor we should escape them properly when creating xml turn instructions.

GH maps link

The ref is tagged as <!? http://www.openstreetmap.org/way/251217044

Activity

  1. changed the title [-]Make GPX response safe[/-] [+]Escape street names for GPX properly[/+] on Nov 24, 2015
  2. karussell commented on Nov 24, 2015

    @karussell
    MemberAuthor

    Moving to a 'proper' XML writer would be probably the simplest thing and could be even faster (?) but due to portability and less deps we should aim for simplicity here IMO. I.e. simple string replacement.

  3. devemux86 commented on Nov 24, 2015

    @devemux86
    Contributor

    👍

  4. karussell commented on Nov 24, 2015

    @karussell
    MemberAuthor

    I'll create a fix via:

    static String simpleXMLEscape( String str )
    {
         return str.replaceAll("&", "&amp;").
                    // but do not care for:
                    replaceAll("[\\<\\>]", "_");
    }
  5. added this to the 0.6 milestone on Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions