Skip to content

Commit f9f4197

Browse files
committed
2 parents 88e7096 + 4dce65f commit f9f4197

File tree

9 files changed

+73
-62
lines changed

9 files changed

+73
-62
lines changed

composer.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openflights.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ function init() {
530530
});
531531
}
532532

533-
// No idea why this is needed, but FF3 disables random buttons without it...
533+
// No idea why this was needed originally; but FF3 disables random buttons without it...
534534
for (var i = 0; i < document.forms["inputform"].elements.length; i++) {
535535
document.forms["inputform"].elements[i].disabled = false;
536536
}
@@ -860,7 +860,7 @@ function onAirportSelect(airport) {
860860
// 2. system is in "demo mode", or
861861
// 3. privacy is set to (O)pen
862862
if (logged_in || demo_mode || privacy == "O") {
863-
// Get list of user flights
863+
// Get a list of user flights
864864
desc +=
865865
" <a href='#' onclick='JavaScript:xmlhttpPost(\"" +
866866
URL_FLIGHTS +
@@ -983,6 +983,11 @@ function onAirportUnselect(airport) {
983983
// do nothing
984984
}
985985

986+
/**
987+
* @param strURL
988+
* @param id
989+
* @param param
990+
*/
986991
function xmlhttpPost(strURL, id, param) {
987992
var self = this;
988993
var query = "";
@@ -991,14 +996,8 @@ function xmlhttpPost(strURL, id, param) {
991996
closeNews();
992997
}
993998

994-
// Mozilla/Safari
995-
if (window.XMLHttpRequest) {
996-
self.xmlHttpReq = new XMLHttpRequest();
997-
}
998-
// IE
999-
else if (window.ActiveXObject) {
1000-
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
1001-
}
999+
// Won't support ancient IE. Chances are they can't load the site anyway...
1000+
self.xmlHttpReq = new XMLHttpRequest();
10021001
self.xmlHttpReq.open("POST", strURL, true);
10031002
self.xmlHttpReq.setRequestHeader(
10041003
"Content-Type",
@@ -1283,7 +1282,7 @@ function xmlhttpPost(strURL, id, param) {
12831282
gt.gettext(
12841283
"'%1' not found in %2 database. Do you want to add it as a new %2 company?"
12851284
),
1286-
[airline, modeoperators[mode], modeoperators[mode]]
1285+
[airline, modeoperators[mode]]
12871286
)
12881287
)
12891288
) {
@@ -1611,7 +1610,9 @@ function updateFilter(str) {
16111610
);
16121611
}
16131612

1614-
// Generate title for current map
1613+
/**
1614+
* Generate title for current map
1615+
*/
16151616
function getMapTitle(closable) {
16161617
var form = document.forms["filterform"];
16171618
var text = "";
@@ -1661,7 +1662,7 @@ function getMapTitle(closable) {
16611662
text = gt.gettext("Recently added flights");
16621663
}
16631664
} else {
1664-
// Viewing another's profile
1665+
// Viewing another user's profile
16651666
if (trid != "0") {
16661667
text = tripname + ' <a href="' + tripurl + '">\u2197</a>';
16671668
} else {
@@ -1858,7 +1859,9 @@ function cloneSelect(oldSelect, name, hook, selected) {
18581859
return newSelect;
18591860
}
18601861

1861-
// Return value of the currently selected radio button in this group
1862+
/**
1863+
* Return value of the currently selected radio button in this group
1864+
*/
18621865
function radioValue(radio) {
18631866
for (var r = 0; r < radio.length; r++) {
18641867
if (radio[r].checked) {
@@ -2092,6 +2095,11 @@ function startListFlights() {
20922095
xmlhttpPost(URL_FLIGHTS, 0, "MAP");
20932096
}
20942097

2098+
/**
2099+
* @param str
2100+
* @param desc
2101+
* @param id
2102+
*/
20952103
function listFlights(str, desc, id) {
20962104
openPane("result");
20972105
fidList = [];
@@ -2106,7 +2114,6 @@ function listFlights(str, desc, id) {
21062114

21072115
var hasGCButton = false;
21082116

2109-
// IE string concat is painfully slow, so we use an array and join it instead
21102117
var table = [];
21112118
table.push(
21122119
// TODO: alt text
@@ -3858,7 +3865,7 @@ function selectAirport(apid, select, quick, code) {
38583865
}
38593866

38603867
/**
3861-
* Change number of rows displayed in multiinput
3868+
* Change the number of rows displayed in multiinput
38623869
* @param type {string}
38633870
*/
38643871
function changeRows(type) {
@@ -4200,7 +4207,9 @@ function logout(str) {
42004207
document.forms["login"].name.focus();
42014208
}
42024209

4203-
// Get current transport mode
4210+
/**
4211+
* Get current transport mode
4212+
*/
42044213
function getMode() {
42054214
if (getCurrentPane() == "input") {
42064215
return document.forms["inputform"].mode.value;
@@ -4516,7 +4525,7 @@ function showLoadingAnimation(show) {
45164525
}
45174526

45184527
/**
4519-
* user has selected a new field in the extra filter
4528+
* User has selected a new field in the extra filter
45204529
*/
45214530
function setExtraFilter() {
45224531
var key = document.forms["filterform"].Extra.value,

php/alsearch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
}
101101
$row = $sth->fetch();
102102
if ($row) {
103-
printf('0;' . sprintf(_('An airline using the IATA code %s exists already.'), $iata));
103+
printf('0;' . sprintf(_('An airline using the IATA code %s exists already.'), htmlspecialchars($iata)));
104104
exit;
105105
}
106106
}
@@ -122,7 +122,7 @@
122122
}
123123
$row = $sth->fetch();
124124
if ($row) {
125-
printf('0;' . sprintf(_('An airline using the ICAO code %s exists already.'), $icao));
125+
printf('0;' . sprintf(_('An airline using the ICAO code %s exists already.'), htmlspecialchars($icao)));
126126
exit;
127127
}
128128
}

php/autocomplete.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
include_once 'helper.php';
44
include_once 'db_pdo.php';
55

6-
// TODO: Why do we do this?
76
/**
87
* Trim anything after a period or left paren
8+
*
9+
* TODO: Why do we do this?
10+
*
911
* @param $query
1012
* @return string
1113
*/

php/git.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public static function getCurrentCommitID() {
1414
$head = trim(file_get_contents(".git/{$matches[1]}"));
1515
}
1616

17-
return $head ? $head : null;
17+
return $head ?: null;
1818
}
1919
}

0 commit comments

Comments
 (0)