From bfd23a0e9b697a650a1315d698544730f7e1a7d3 Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 19:18:59 +0000 Subject: [PATCH] Update file news.php --- html/news.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/news.php b/html/news.php index 51319f0b..21d1fb87 100644 --- a/html/news.php +++ b/html/news.php @@ -47,8 +47,8 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { prepare("SELECT ID, titre, date FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); + $search = isset($_GET['search']) ? htmlspecialchars($_GET['search']) : ""; + $req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE (titre LIKE :search OR ID LIKE '%:search%' OR auteur LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); $req->bindParam(":search", $search); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute();