Skip to content

Commit

Permalink
correct/add quotename (joomla#12070)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva authored and Thomas Hunziker committed Sep 20, 2016
1 parent eb5cd28 commit 942db14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions libraries/cms/component/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public static function isInstalled($option)

return (int) $db->setQuery(
$db->getQuery(true)
->select('COUNT(extension_id)')
->from('#__extensions')
->where('element = ' . $db->quote($option))
->where('type = ' . $db->quote('component'))
->select('COUNT(' . $db->quoteName('extension_id') . ')')
->from($db->quoteName('#__extensions'))
->where($db->quoteName('element') . ' = ' . $db->quote($option))
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
)->loadResult();
}

Expand Down Expand Up @@ -436,8 +436,8 @@ protected static function load($option)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('extension_id AS id, element AS "option", params, enabled')
->from('#__extensions')
->select($db->quoteName(array('extension_id', 'element', 'params', 'enabled'), array('id', 'option', null, null)))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
$db->setQuery($query);

Expand Down
4 changes: 2 additions & 2 deletions libraries/cms/library/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ protected static function _load($element)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('extension_id AS id, element AS "option", params, enabled')
->from('#__extensions')
->select($db->quoteName(array('extension_id', 'element', 'params', 'enabled'), array('id', 'option', null, null)))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('library'))
->where($db->quoteName('element') . ' = ' . $db->quote($element));
$db->setQuery($query);
Expand Down

0 comments on commit 942db14

Please sign in to comment.