Fix 'See Photos' link for hyphenated registrations

\W would probably work for the regex, but I wanted to make it as narrow as possible.
This commit is contained in:
Robert 2017-01-24 11:27:25 -06:00 committed by GitHub
parent a0c11c4156
commit 0afe1441de

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 "";