From aa4106f00a9dbdbe25d0c215089a4862cf0be123 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 23 May 2015 10:57:30 -0400 Subject: [PATCH] Change the way the values are quoted, use truncate instead of truncateComplex (Fix #95) --- .../PatchTester/Model/PullsModel.php | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php b/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php index 69ebc78..7dd5cb6 100644 --- a/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php +++ b/administrator/components/com_patchtester/PatchTester/Model/PullsModel.php @@ -343,14 +343,27 @@ class PullsModel extends \JModelDatabase foreach ($pulls as $pull) { // Build the data object to store in the database - $pullData = array($pull->number, $pull->title, \JHtml::_('string.truncateComplex', $pull->body, 100), $pull->html_url); - $data[] = implode($this->getDb()->quote($pullData), ','); + $pullData = array( + $pull->number, + $this->getDb()->quote($pull->title), + $this->getDb()->quote(\JHtml::_('string.truncate', $pull->body, 100)), + $this->getDb()->quote($pull->html_url) + ); + + $data[] = implode($pullData, ','); } $this->getDb()->setQuery( - $this->db->getQuery(true) - ->insert('#__patchtester_pulls') - ->columns('pull_id, title, description, pull_url') + $this->getDb()->getQuery(true) + ->insert($this->getDb()->quoteName('#__patchtester_pulls')) + ->columns( + array( + $this->getDb()->quoteName('pull_id'), + $this->getDb()->quoteName('title'), + $this->getDb()->quoteName('description'), + $this->getDb()->quoteName('pull_url') + ) + ) ->values($data) );