format
This commit is contained in:
@@ -76,10 +76,10 @@ class Image
|
|||||||
public static function by_id(int $id): ?Image
|
public static function by_id(int $id): ?Image
|
||||||
{
|
{
|
||||||
global $database;
|
global $database;
|
||||||
if($id > 2**32) {
|
if ($id > 2**32) {
|
||||||
// for some reason bots query huge numbers and pollute the DB error logs...
|
// for some reason bots query huge numbers and pollute the DB error logs...
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$row = $database->get_row("SELECT * FROM images WHERE images.id=:id", ["id"=>$id]);
|
$row = $database->get_row("SELECT * FROM images WHERE images.id=:id", ["id"=>$id]);
|
||||||
return ($row ? new Image($row) : null);
|
return ($row ? new Image($row) : null);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user