Skip to content

Commit

Permalink
convert to prepared
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Jun 11, 2019
1 parent 1751e66 commit f124584
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Database\ParameterType;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -50,6 +51,7 @@ public function association($articleid)
}

// Get the associated menu items
$associations = array_values($associations);
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('c.*')
Expand All @@ -58,11 +60,12 @@ public function association($articleid)
->from('#__content as c')
->select('cat.title as category_title')
->join('LEFT', '#__categories as cat ON cat.id=c.catid')
->where('c.id IN (' . implode(',', array_values($associations)) . ')')
->where('c.id != ' . $articleid)
->whereIn($db->quoteName('c.id'), $associations)
->where($db->quoteName('c.id') . ' != :articleid')
->join('LEFT', '#__languages as l ON c.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
->select('l.title as language_title')
->bind(':articleid', $articleid, ParameterType::INTEGER);
$db->setQuery($query);

try
Expand Down

0 comments on commit f124584

Please sign in to comment.