From 2beee89e508b89842adf1b7f27ac589729f907d3 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 22 Feb 2015 16:25:54 -0500 Subject: [PATCH] Need to quote data values, tweak query building --- .../com_patchtester/PatchTester/Model/PullsModel.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php b/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php index ac94a02..3647c52 100644 --- a/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php +++ b/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php @@ -340,12 +340,15 @@ class PullsModel extends \JModelDatabase { // Build the data object to store in the database $pullData = array($pull->number, $pull->title, $pull->body, $pull->html_url); - $data[] = implode($pullData, ','); + $data[] = implode($this->getDb()->quote($pullData), ','); } - $query = $this->getDb()->getQuery(); - $query->insert('#__patchtester_pulls')->columns('pull_id, title, description, pull_url')->values($data); - $this->getDb()->setQuery($query); + $this->getDb()->setQuery( + $this->db->getQuery(true) + ->insert('#__patchtester_pulls') + ->columns('pull_id, title, description, pull_url') + ->values($data) + ); try {