From 02a503320df1255040a5afaabbfd2d07ef3511c4 Mon Sep 17 00:00:00 2001 From: stiti Date: Fri, 7 Jun 2024 14:14:16 +0200 Subject: [PATCH] =?UTF-8?q?Commit=20de=20Louay=20:=20am=C3=A9lioration=20d?= =?UTF-8?q?u=20code=20pour=20=C3=A9viter=20les=20erreurs=20du=20W3C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodeIgniter-3.1.13/application/models/Model_playlist.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CodeIgniter-3.1.13/application/models/Model_playlist.php b/CodeIgniter-3.1.13/application/models/Model_playlist.php index 9a721d3..80a329d 100644 --- a/CodeIgniter-3.1.13/application/models/Model_playlist.php +++ b/CodeIgniter-3.1.13/application/models/Model_playlist.php @@ -26,10 +26,16 @@ class Model_playlist extends CI_Model { // Récupérer toutes les playlists d'un utilisateur spécifique public function get_user_playlists($user_id) { + if ($user_id === NULL) { + return; + } else{ + + $this->db->where('utilisateur_id', $user_id); // Ne récupérer que les playlists publiques ou celles appartenant à l'utilisateur $this->db->where('(public = 1 OR utilisateur_id = ' . $user_id . ')'); return $this->db->get('playlist')->result(); + } } // Mettre à jour une playlist