This commit is contained in:
Shish 2020-08-01 21:01:47 +00:00
parent 49e4c3f9c7
commit cb6c9ba987
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,9 @@ class NotATag extends Extension
$pairs = $database->get_pairs("SELECT LOWER(tag), redirect FROM untags"); $pairs = $database->get_pairs("SELECT LOWER(tag), redirect FROM untags");
foreach ($pairs as $tag => $url) { foreach ($pairs as $tag => $url) {
if (in_array(strtolower($tag), $tags)) { // cast to string because PHP automatically turns ["69" => "No sex"]
// into [69 => "No sex"]
if (in_array(strtolower((string)$tag), $tags)) {
throw new TagSetException("Invalid tag used: $tag", $url); throw new TagSetException("Invalid tag used: $tag", $url);
} }
} }

View File

@ -152,7 +152,7 @@ class NumericScore extends Extension
$result = $database->get_col($sql, $args); $result = $database->get_col($sql, $args);
$images = []; $images = [];
foreach ($result as $id) { foreach ($result as $id) {
$images[] = Image::by_id(int_escape($id)); $images[] = Image::by_id((int)$id);
} }
$this->theme->view_popular($images, $dte); $this->theme->view_popular($images, $dte);