From 47768831c07fef6d44a7ba5266aba056644f7d97 Mon Sep 17 00:00:00 2001 From: TheShinyMelon Date: Mon, 18 Nov 2024 23:18:36 +0100 Subject: [PATCH] FIX: DB stuff now more safe and more working, very nice; CHANGE: 'monochrome' color scheme and changed animation --- app/db_connector.php | 11 +++++++++-- project_files/audio-sprite.ase | Bin 0 -> 1375 bytes project_files/ffmpeg_gif.sh | 2 ++ public/image.php | 6 +++--- public/index.php | 2 +- public/resources/img/8_original_font.png | Bin 0 -> 2491 bytes public/resources/img/8_spinning_30fps_bw.gif | Bin 0 -> 1098516 bytes public/resources/img/audio-sprite.gif | Bin 0 -> 535 bytes public/resources/stylesheet.css | 10 +++++----- 9 files changed, 20 insertions(+), 11 deletions(-) create mode 100755 project_files/audio-sprite.ase create mode 100755 project_files/ffmpeg_gif.sh create mode 100755 public/resources/img/8_original_font.png create mode 100755 public/resources/img/8_spinning_30fps_bw.gif create mode 100755 public/resources/img/audio-sprite.gif diff --git a/app/db_connector.php b/app/db_connector.php index 734b7a2..46c288d 100755 --- a/app/db_connector.php +++ b/app/db_connector.php @@ -9,9 +9,16 @@ } function get_images($pdo, $search='%', $sort='img_date', $sdir='DESC') { - $params = array('search' => $search, 'sort' => $sort, 'sdir' => $sdir); - $stmt = $pdo->prepare("SELECT * FROM images WHERE img_title LIKE CONCAT('%', :search ,'%') ORDER BY :sort :sdir;"); + if ($sort != 'img_date' && $sdir != 'ASC') { + if ($sort != 'img_title' && $sdir != 'DESC') { + echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir); + die(); + } + } + $params = array('search' => $search); + $stmt = $pdo->prepare("SELECT * FROM images WHERE img_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;"); $stmt->execute($params); + // $stmt->debugDumpParams(); $data = $stmt->fetchAll(); $img_list = '