Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
Escape some output in alsearch.php
  • Loading branch information
jpatokal authored Aug 22, 2024
2 parents 17273e9 + e7f5d81 commit bbaa763
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions php/alsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
sprintf(
_("A %s using the name or alias %s exists already."),
MODES_OPERATOR[$mode],
$name
htmlspecialchars($name)
));
exit;
}
Expand All @@ -77,7 +77,7 @@
sprintf(
_("A %s using the name or alias %s exists already."),
MODES_OPERATOR[$mode],
$alias
htmlspecialchars($alias)
));
exit;
}
Expand Down Expand Up @@ -226,15 +226,15 @@
if ($mode == "F" && $iatafilter != "false") {
$filters[] = "iata NOT IN ('', 'N/A')";
}
if (!$offset) {
if (!$offset || !is_int($offset)) {
$offset = 0;
}

$sql = "SELECT * FROM airlines WHERE " . implode(" AND ", $filters) . " ORDER BY name";

$sth = $dbh->prepare($sql . " LIMIT 10 OFFSET " . $offset);
if (!$sth->execute($filterParams)) {
die('0;' . sprintf(_('Operation %s failed.'), $action));
die('0;' . sprintf(_('Operation %s failed.'), htmlspecialchars($action)));
}
$sth2 = $dbh->prepare(str_replace("*", "COUNT(*)", $sql));
$sth2->execute($filterParams);
Expand Down

0 comments on commit bbaa763

Please sign in to comment.