corrected styleCI issues for sql querys

This commit is contained in:
SrS2225a 2023-08-13 23:40:06 -07:00
parent 32b8a16c40
commit a11a9307ea

View file

@ -206,7 +206,7 @@ class MediaController extends Controller
$vanity = preg_replace('/[^a-z0-9]+/', '-', strtolower($vanity)); $vanity = preg_replace('/[^a-z0-9]+/', '-', strtolower($vanity));
//handle collisions //handle collisions
$collision = $this->database->query('SELECT * FROM `uploads` WHERE `code` = ? AND `id` != ? LIMIT 1',[$vanity, $id])->fetch(); $collision = $this->database->query('SELECT * FROM `uploads` WHERE `code` = ? AND `id` != ? LIMIT 1', [$vanity, $id])->fetch();
if (!$media) { if (!$media) {
throw new HttpNotFoundException($request); throw new HttpNotFoundException($request);
@ -216,7 +216,7 @@ class MediaController extends Controller
throw new HttpBadRequestException($request); throw new HttpBadRequestException($request);
} }
$this->database->query('UPDATE `uploads` SET `code` = ? WHERE `id` = ?',[$vanity, $media->id]); $this->database->query('UPDATE `uploads` SET `code` = ? WHERE `id` = ?', [$vanity, $media->id]);
$media->code = $vanity; $media->code = $vanity;
$response->getBody()->write(json_encode($media)); $response->getBody()->write(json_encode($media));