From a4447043c43de1e4edbc371c5fb2dcb38aa1cad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=A7=CF=83=E2=84=93=CF=83?= <76647363+Holo795@users.noreply.github.com> Date: Wed, 21 Apr 2021 12:49:36 +0200 Subject: [PATCH] Fix apostrophes in database --- Controller/ForumController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Controller/ForumController.php b/Controller/ForumController.php index 1ebee3c..6ea8c2c 100644 --- a/Controller/ForumController.php +++ b/Controller/ForumController.php @@ -1062,10 +1062,10 @@ public function admin_edit($type = false, $id = false) if ($this->request->is('ajax')) { $this->autoRender = false; if (!empty($this->request->data['name']) && !empty($this->request->data['position']) && !empty($this->request->data['image'])) { - $name = $this->request->data['name']; + $name = str_replace("'", "'", $this->request->data['name']); $position = $this->request->data['position']; $image = $this->request->data['image']; - $description = $this->request->data['description']; + $description = str_replace("'", "'", $this->request->data['description']); $this->Forum->update('forum', $this->request->data['id'], ['name' => $name, 'position' => $position, 'image' => $image, 'forum_description' => $description]); @@ -1084,7 +1084,7 @@ public function admin_edit($type = false, $id = false) $this->response->body(json_encode(array('statut' => true, 'msg' => $this->Lang->get('FORUM__ADD__SUCCESS')))); } elseif(!empty($this->request->data['name_category'])) { - $name = $this->urlRew($this->request->data['name_category']); + $name = str_replace("'", "'", $this->urlRew($this->request->data['name_category'])); $parent = $this->request->data['parent']; $position = $this->request->data['position']; $image = $this->request->data['image'];