diff --git a/administrator/components/com_banners/tables/client.php b/administrator/components/com_banners/tables/client.php index 98a40692b2a5c..bf926c9fac77a 100644 --- a/administrator/components/com_banners/tables/client.php +++ b/administrator/components/com_banners/tables/client.php @@ -72,7 +72,7 @@ public function publish($pks = null, $state = 1, $userId = 0) } // Build the WHERE clause for the primary keys. - $where = $k . '=' . implode(' OR ' . $k . '=', $pks); + $where = $this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'; // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) @@ -88,7 +88,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $this->_db->setQuery( 'UPDATE ' . $this->_db->quoteName($this->_tbl) . ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state . - ' WHERE (' . $where . ')' . + ' WHERE ' . $where . $checkin ); diff --git a/administrator/components/com_finder/tables/filter.php b/administrator/components/com_finder/tables/filter.php index b644d9f60d075..2f7fbf0d9b3b7 100644 --- a/administrator/components/com_finder/tables/filter.php +++ b/administrator/components/com_finder/tables/filter.php @@ -130,7 +130,7 @@ public function publish($pks = null, $state = 1, $userId = 0) } // Build the WHERE clause for the primary keys. - $where = $k . '=' . implode(' OR ' . $k . '=', $pks); + $where = $this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'; // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) diff --git a/administrator/components/com_finder/tables/map.php b/administrator/components/com_finder/tables/map.php index 5a77dafc0ad60..406ebea039cc6 100644 --- a/administrator/components/com_finder/tables/map.php +++ b/administrator/components/com_finder/tables/map.php @@ -68,7 +68,7 @@ public function publish($pks = null, $state = 1, $userId = 0) } // Build the WHERE clause for the primary keys. - $where = $k . '=' . implode(' OR ' . $k . '=', $pks); + $where = $this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'; // Update the publishing state for rows with the given primary keys. $query = $this->_db->getQuery(true) diff --git a/administrator/components/com_users/tables/note.php b/administrator/components/com_users/tables/note.php index 32120980cbc22..c65d99123e323 100644 --- a/administrator/components/com_users/tables/note.php +++ b/administrator/components/com_users/tables/note.php @@ -106,7 +106,7 @@ public function publish($pks = null, $state = 1, $userId = 0) ->set($this->_db->quoteName('state') . ' = ' . (int) $state); // Build the WHERE clause for the primary keys. - $query->where($k . '=' . implode(' OR ' . $k . '=', $pks)); + $query->where($this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'); // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) diff --git a/administrator/components/com_weblinks/tables/weblink.php b/administrator/components/com_weblinks/tables/weblink.php index e04fbacdd2216..0f30d5511572b 100644 --- a/administrator/components/com_weblinks/tables/weblink.php +++ b/administrator/components/com_weblinks/tables/weblink.php @@ -237,7 +237,7 @@ public function publish($pks = null, $state = 1, $userId = 0) } // Build the WHERE clause for the primary keys. - $where = $k.'='.implode(' OR '.$k.'=', $pks); + $where = $this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'; // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) @@ -253,7 +253,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $this->_db->setQuery( 'UPDATE '.$this->_db->quoteName($this->_tbl) . ' SET '.$this->_db->quoteName('state').' = '.(int) $state . - ' WHERE ('.$where.')' . + ' WHERE ' . $where . $checkin ); diff --git a/libraries/joomla/table/extension.php b/libraries/joomla/table/extension.php index 2cd6ae8032e8f..089dc70cc3168 100644 --- a/libraries/joomla/table/extension.php +++ b/libraries/joomla/table/extension.php @@ -148,7 +148,7 @@ public function publish($pks = null, $state = 1, $userId = 0) } // Build the WHERE clause for the primary keys. - $where = $k . '=' . implode(' OR ' . $k . '=', $pks); + $where = $this->_db->quoteName($k) . ' IN (' . implode(',', $pks) . ')'; // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) @@ -164,7 +164,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $query = $this->_db->getQuery(true) ->update($this->_db->quoteName($this->_tbl)) ->set($this->_db->quoteName('enabled') . ' = ' . (int) $state) - ->where('(' . $where . ')' . $checkin); + ->where($where . $checkin); $this->_db->setQuery($query); $this->_db->execute(); diff --git a/libraries/joomla/table/user.php b/libraries/joomla/table/user.php index e09520efb4b68..1b0a3894c0b92 100644 --- a/libraries/joomla/table/user.php +++ b/libraries/joomla/table/user.php @@ -145,7 +145,7 @@ public function bind($array, $ignore = '') ->select($this->_db->quoteName('id')) ->select($this->_db->quoteName('title')) ->from($this->_db->quoteName('#__usergroups')) - ->where($this->_db->quoteName('id') . ' = ' . implode(' OR ' . $this->_db->quoteName('id') . ' = ', $this->groups)); + ->where($this->_db->quoteName('id') . ' IN (' . implode(',', $this->groups) . ')'); $this->_db->setQuery($query); // Set the titles for the user groups. diff --git a/libraries/joomla/user/helper.php b/libraries/joomla/user/helper.php index 4b3a1b0bd5471..89c084158ced3 100644 --- a/libraries/joomla/user/helper.php +++ b/libraries/joomla/user/helper.php @@ -163,7 +163,7 @@ public static function setUserGroups($userId, $groups) $query = $db->getQuery(true) ->select($db->quoteName('id') . ', ' . $db->quoteName('title')) ->from($db->quoteName('#__usergroups')) - ->where($db->quoteName('id') . ' = ' . implode(' OR ' . $db->quoteName('id') . ' = ', $user->groups)); + ->where($db->quoteName('id') . ' IN (' . implode(', ', $user->groups) . ')'); $db->setQuery($query); $results = $db->loadObjectList();