diff --git a/composer.lock b/composer.lock index 008b762b..59e01142 100644 --- a/composer.lock +++ b/composer.lock @@ -457,16 +457,16 @@ }, { "name": "knplabs/github-api", - "version": "v3.15.0", + "version": "v3.14.1", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "d4b7a1c00e22c1ca32408ecdd4e33c674196b1bc" + "reference": "71fec50e228737ec23c0b69801b85bf596fbdaca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/d4b7a1c00e22c1ca32408ecdd4e33c674196b1bc", - "reference": "d4b7a1c00e22c1ca32408ecdd4e33c674196b1bc", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/71fec50e228737ec23c0b69801b85bf596fbdaca", + "reference": "71fec50e228737ec23c0b69801b85bf596fbdaca", "shasum": "" }, "require": { @@ -486,7 +486,7 @@ }, "require-dev": { "guzzlehttp/guzzle": "^7.2", - "guzzlehttp/psr7": "^2.7", + "guzzlehttp/psr7": "^1.7", "http-interop/http-factory-guzzle": "^1.0", "php-http/mock-client": "^1.4.1", "phpstan/extension-installer": "^1.0.5", @@ -533,7 +533,7 @@ ], "support": { "issues": "https://github.com/KnpLabs/php-github-api/issues", - "source": "https://github.com/KnpLabs/php-github-api/tree/v3.15.0" + "source": "https://github.com/KnpLabs/php-github-api/tree/v3.14.1" }, "funding": [ { @@ -541,7 +541,7 @@ "type": "github" } ], - "time": "2024-09-23T19:00:43+00:00" + "time": "2024-03-24T18:21:15+00:00" }, { "name": "php-http/cache-plugin", @@ -600,16 +600,16 @@ }, { "name": "php-http/client-common", - "version": "2.7.2", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" + "reference": "1e19c059b0e4d5f717bf5d524d616165aeab0612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", + "url": "https://api.github.com/repos/php-http/client-common/zipball/1e19c059b0e4d5f717bf5d524d616165aeab0612", + "reference": "1e19c059b0e4d5f717bf5d524d616165aeab0612", "shasum": "" }, "require": { @@ -663,9 +663,9 @@ ], "support": { "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.2" + "source": "https://github.com/php-http/client-common/tree/2.7.1" }, - "time": "2024-09-24T06:21:48+00:00" + "time": "2023-11-30T10:31:25+00:00" }, { "name": "php-http/discovery", @@ -748,16 +748,16 @@ }, { "name": "php-http/httplug", - "version": "2.4.1", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", + "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", + "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", "shasum": "" }, "require": { @@ -799,9 +799,9 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.1" + "source": "https://github.com/php-http/httplug/tree/2.4.0" }, - "time": "2024-09-23T11:39:58+00:00" + "time": "2023-04-14T15:10:03+00:00" }, { "name": "php-http/message", @@ -3649,16 +3649,16 @@ }, { "name": "symfony/console", - "version": "v5.4.44", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83" + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83", + "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", "shasum": "" }, "require": { @@ -3728,7 +3728,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.44" + "source": "https://github.com/symfony/console/tree/v5.4.43" }, "funding": [ { @@ -3744,7 +3744,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-08-13T16:31:56+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4149,16 +4149,16 @@ }, { "name": "symfony/string", - "version": "v5.4.44", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24" + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24", + "url": "https://api.github.com/repos/symfony/string/zipball/8be1d484951ff5ca995eaf8edcbcb8b9a5888450", + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450", "shasum": "" }, "require": { @@ -4215,7 +4215,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.44" + "source": "https://github.com/symfony/string/tree/v5.4.43" }, "funding": [ { @@ -4231,7 +4231,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-08-01T10:24:28+00:00" }, { "name": "theseer/tokenizer", @@ -4304,5 +4304,5 @@ "ext-simplexml": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/openflights.js b/openflights.js index c1657a9a..af6cbf3d 100644 --- a/openflights.js +++ b/openflights.js @@ -530,7 +530,7 @@ function init() { }); } - // No idea why this is needed, but FF3 disables random buttons without it... + // No idea why this was needed originally; but FF3 disables random buttons without it... for (var i = 0; i < document.forms["inputform"].elements.length; i++) { document.forms["inputform"].elements[i].disabled = false; } @@ -860,7 +860,7 @@ function onAirportSelect(airport) { // 2. system is in "demo mode", or // 3. privacy is set to (O)pen if (logged_in || demo_mode || privacy == "O") { - // Get list of user flights + // Get a list of user flights desc += " \u2197'; } else { @@ -1858,7 +1859,9 @@ function cloneSelect(oldSelect, name, hook, selected) { return newSelect; } -// Return value of the currently selected radio button in this group +/** + * Return value of the currently selected radio button in this group + */ function radioValue(radio) { for (var r = 0; r < radio.length; r++) { if (radio[r].checked) { @@ -2092,6 +2095,11 @@ function startListFlights() { xmlhttpPost(URL_FLIGHTS, 0, "MAP"); } +/** + * @param str + * @param desc + * @param id + */ function listFlights(str, desc, id) { openPane("result"); fidList = []; @@ -2106,7 +2114,6 @@ function listFlights(str, desc, id) { var hasGCButton = false; - // IE string concat is painfully slow, so we use an array and join it instead var table = []; table.push( // TODO: alt text @@ -3858,7 +3865,7 @@ function selectAirport(apid, select, quick, code) { } /** - * Change number of rows displayed in multiinput + * Change the number of rows displayed in multiinput * @param type {string} */ function changeRows(type) { @@ -4200,7 +4207,9 @@ function logout(str) { document.forms["login"].name.focus(); } -// Get current transport mode +/** + * Get current transport mode + */ function getMode() { if (getCurrentPane() == "input") { return document.forms["inputform"].mode.value; @@ -4516,7 +4525,7 @@ function showLoadingAnimation(show) { } /** - * user has selected a new field in the extra filter + * User has selected a new field in the extra filter */ function setExtraFilter() { var key = document.forms["filterform"].Extra.value, diff --git a/php/alsearch.php b/php/alsearch.php index df043e57..de627e70 100644 --- a/php/alsearch.php +++ b/php/alsearch.php @@ -100,7 +100,7 @@ } $row = $sth->fetch(); if ($row) { - printf('0;' . sprintf(_('An airline using the IATA code %s exists already.'), $iata)); + printf('0;' . sprintf(_('An airline using the IATA code %s exists already.'), htmlspecialchars($iata))); exit; } } @@ -122,7 +122,7 @@ } $row = $sth->fetch(); if ($row) { - printf('0;' . sprintf(_('An airline using the ICAO code %s exists already.'), $icao)); + printf('0;' . sprintf(_('An airline using the ICAO code %s exists already.'), htmlspecialchars($icao))); exit; } } diff --git a/php/autocomplete.php b/php/autocomplete.php index 1a80cb9b..140374ef 100644 --- a/php/autocomplete.php +++ b/php/autocomplete.php @@ -3,9 +3,11 @@ include_once 'helper.php'; include_once 'db_pdo.php'; -// TODO: Why do we do this? /** * Trim anything after a period or left paren + * + * TODO: Why do we do this? + * * @param $query * @return string */ diff --git a/php/git.php b/php/git.php index ace772ee..17a82878 100644 --- a/php/git.php +++ b/php/git.php @@ -14,6 +14,6 @@ public static function getCurrentCommitID() { $head = trim(file_get_contents(".git/{$matches[1]}")); } - return $head ? $head : null; + return $head ?: null; } } diff --git a/php/import.php b/php/import.php index d0093d25..0017cea6 100644 --- a/php/import.php +++ b/php/import.php @@ -43,7 +43,7 @@ function nth_text($element, $n) { return nbsp_trim($item->textContent); } - // Shouldn't be needed in most cases, as we should be checking for the number of pieces we text, + // Shouldn't be necessary in most cases, as we should be checking for the number of pieces we text, // as some are optional. // If the item ($n) we were looking for isn't there, just return an empty string. return ''; @@ -355,7 +355,7 @@ function die_nicely($msg) { break; default: - die_nicely(sprintf(_("Unknown action %s"), $action)); + die_nicely(sprintf(_("Unknown action %s"), htmlspecialchars($action))); } $fileType = $_POST["fileType"]; @@ -370,7 +370,7 @@ function die_nicely($msg) { if ($html['title']->text() != "FlightMemory - FlightData") { die_nicely( - sprintf(_("Sorry, the file %s does not appear to contain FlightMemory FlightData."), $uploadFile) + sprintf(_("Sorry, the file %s does not appear to contain FlightMemory FlightData."), htmlspecialchars($uploadFile)) ); } @@ -393,7 +393,7 @@ function die_nicely($msg) { break; default: - die_nicely(sprintf(_("Unknown file type %s"), $fileType)); + die_nicely(sprintf(_("Unknown file type %s"), htmlspecialchars($fileType))); } if ($action == _("Upload")) { diff --git a/php/map.php b/php/map.php index 064425eb..a394781e 100644 --- a/php/map.php +++ b/php/map.php @@ -5,7 +5,7 @@ include_once 'helper.php'; include_once 'filter.php'; -// This applies only when viewing another users flights +// This applies only when viewing another user's flights $user = $_POST["user"] ?? ($_GET["user"] ?? null); $trid = $_POST["trid"] ?? ($_GET["trid"] ?? null); diff --git a/php/settings.php b/php/settings.php index f88a965b..e8eab784 100644 --- a/php/settings.php +++ b/php/settings.php @@ -88,7 +88,7 @@ $success = $sth->execute($params); } if (!$success) { - die("0;" . sprintf(_("Operation on user %s failed."), $name)); + die("0;" . sprintf(_("Operation on user %s failed."), htmlspecialchars($name))); } // In all cases, change locale and units to user selection diff --git a/php/trip.php b/php/trip.php index 0d043bb2..7816c611 100644 --- a/php/trip.php +++ b/php/trip.php @@ -7,7 +7,7 @@ $trid = $_POST["trid"] ?? null; if ($type != "NEW" && (!$trid || $trid == 0)) { - die('0;Trip ID ' . $trid . ' invalid'); + die("0;" . sprintf(_("Trip ID %s invalid."), htmlspecialchars($trid))); } $uid = $_SESSION["uid"]; @@ -21,7 +21,7 @@ */ function failIfFalse($res, $name) { if (!$res) { - die('0;Operation on trip ' . $name . ' failed.'); + die("0;" . sprintf(_("Operation on trip %s failed."), htmlspecialchars($name))); } }