Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Resource template replacement. #7668

Merged
merged 1 commit into from
Mar 25, 2019
Merged

Fix Resource template replacement. #7668

merged 1 commit into from
Mar 25, 2019

Conversation

shunter
Copy link
Contributor

@shunter shunter commented Mar 21, 2019

The previous implementation did not work with template keys that are numbers, because the regex syntax was not escaped properly when building a regex from a string.

Instead of building a separate regex for each replacement, we can simply run a single replace with a callback method.

This fixes the ability to construct Iau2006XysData with a xysFileUrlTemplate, which was a regression since #6035.

@cesium-concierge
Copy link

Thanks for the pull request @shunter!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@shunter shunter force-pushed the fixResourceTemplating branch 2 times, most recently from 8be93e4 to a485b5b Compare March 21, 2019 20:14
The previous implementation did not work with template keys that are numbers,
because the regex syntax was not escaped properly.  Instead of building
a regex for each replacement, we can use a replace callback method.
@shunter shunter force-pushed the fixResourceTemplating branch from a485b5b to fb82376 Compare March 22, 2019 14:48
Copy link
Contributor

@emackey emackey left a comment

Choose a reason for hiding this comment

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

Had to Google the .*? un-greedy matcher pattern, but now I'm convinced this is the correct fix.

@emackey emackey merged commit 26f4708 into master Mar 25, 2019
@emackey emackey deleted the fixResourceTemplating branch March 25, 2019 18:04
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.

3 participants