Merge pull request #6 from rparenton/see_photos_fix

Fix 'See Photos' link for hyphenated registrations
This commit is contained in:
Oliver Jowett 2017-01-25 19:14:05 +00:00 committed by GitHub
commit cde047aac3

View file

@ -1378,7 +1378,7 @@ function getFlightAwareModeSLink(code, ident, linkText) {
function getFlightAwarePhotoLink(registration) {
if (registration !== null && registration !== "") {
return "<a target=\"_blank\" href=\"https://flightaware.com/photos/aircraft/" + registration.trim() + "\">See Photos</a>";
return "<a target=\"_blank\" href=\"https://flightaware.com/photos/aircraft/" + registration.replace(/[^0-9a-z]/ig,'') + "\">See Photos</a>";
}
return "";