Skip to content

Conversation

@josh-vin
Copy link

@josh-vin josh-vin commented Jan 8, 2026

Ensures route names and descriptions are properly escaped when generating GPX files, preventing potential XML parsing issues. Sanitizes the filename to be downloaded.
image

I was getting this error on this website: https://www.freeformatter.com/xml-validator-xsd.html
image

Ensures route names and descriptions are properly escaped
when generating GPX files, preventing potential XML parsing issues.
Sanitizes the filename to be downloaded.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds XML escaping and filename sanitization to the GPX file generation feature to prevent XML parsing errors and filesystem issues.

  • Implements XML special character escaping for route names and descriptions
  • Adds filename sanitization to remove invalid filesystem characters
  • Applies escaping to GPX XML content and download filenames

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


const sanitizeFilename = (name = '') =>
String(name)
.replace(/[\/:*?"<>|]/g, '')
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sanitizeFilename function is missing the backslash character '' in the regex pattern. The current pattern [\/:*?"<>|] includes forward slash but not backslash, which is also an invalid filename character on Windows and should be removed. The pattern should be [\\/:*?"<>|] to include both forward slash and backslash.

Suggested change
.replace(/[\/:*?"<>|]/g, '')
.replace(/[\\/:*?"<>|]/g, '')

Copilot uses AI. Check for mistakes.
@Mygod Mygod merged commit 7bd5ce1 into WatWowMap:develop Jan 8, 2026
2 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 8, 2026
# [1.41.0-develop.5](v1.41.0-develop.4...v1.41.0-develop.5) (2026-01-08)

### Bug Fixes

* escape gpx xml ([#1186](#1186)) ([7bd5ce1](7bd5ce1))
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

🎉 This PR is included in version 1.41.0-develop.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants