corrected styleCI issues for sql querys
This commit is contained in:
parent
32b8a16c40
commit
a11a9307ea
1 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ class MediaController extends Controller
|
|||
$vanity = preg_replace('/[^a-z0-9]+/', '-', strtolower($vanity));
|
||||
|
||||
//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) {
|
||||
throw new HttpNotFoundException($request);
|
||||
|
@ -216,7 +216,7 @@ class MediaController extends Controller
|
|||
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;
|
||||
$response->getBody()->write(json_encode($media));
|
||||
|
||||
|
|
Loading…
Reference in a new issue