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:
parent
a0c11c4156
commit
0afe1441de
|
@ -1378,7 +1378,7 @@ function getFlightAwareModeSLink(code, ident, linkText) {
|
||||||
|
|
||||||
function getFlightAwarePhotoLink(registration) {
|
function getFlightAwarePhotoLink(registration) {
|
||||||
if (registration !== null && 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 "";
|
return "";
|
||||||
|
|
Loading…
Reference in a new issue