diff --git a/administrator/components/com_banners/models/banners.php b/administrator/components/com_banners/models/banners.php index aa03b61ca3c2b..39822ae41b089 100644 --- a/administrator/components/com_banners/models/banners.php +++ b/administrator/components/com_banners/models/banners.php @@ -142,7 +142,7 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.name LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } @@ -158,7 +158,7 @@ protected function getListQuery() if ($orderCol == 'ordering' || $orderCol == 'category_title') { $orderCol = 'category_title '.$orderDirn.', ordering'; } - $query->order($db->getEscaped($orderCol.' '.$orderDirn)); + $query->order($db->escape($orderCol.' '.$orderDirn)); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_banners/models/clients.php b/administrator/components/com_banners/models/clients.php index 96dd4882c1e43..964112bf45ee0 100644 --- a/administrator/components/com_banners/models/clients.php +++ b/administrator/components/com_banners/models/clients.php @@ -142,13 +142,13 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.name LIKE '.$search); } } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_banners/models/tracks.php b/administrator/components/com_banners/models/tracks.php index cb842c67de93c..684d9061ec15d 100644 --- a/administrator/components/com_banners/models/tracks.php +++ b/administrator/components/com_banners/models/tracks.php @@ -152,7 +152,7 @@ protected function getListQuery() // Add the list ordering clause. $orderCol = $this->getState('list.ordering', 'name'); - $query->order($db->getEscaped($orderCol).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($orderCol).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/administrator/components/com_categories/models/categories.php b/administrator/components/com_categories/models/categories.php index f4a4b11f8c43a..7b4675b7bc9a1 100644 --- a/administrator/components/com_categories/models/categories.php +++ b/administrator/components/com_categories/models/categories.php @@ -199,11 +199,11 @@ function getListQuery() $query->where('a.id = '.(int) substr($search, 3)); } elseif (stripos($search, 'author:') === 0) { - $search = $db->Quote('%'.$db->getEscaped(substr($search, 7), true).'%'); + $search = $db->Quote('%'.$db->escape(substr($search, 7), true).'%'); $query->where('(ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')'); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.' OR a.note LIKE '.$search.')'); } } @@ -214,7 +214,7 @@ function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.title')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.title')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_checkin/models/checkin.php b/administrator/components/com_checkin/models/checkin.php index 926daa4fab575..7fd06474a9b07 100644 --- a/administrator/components/com_checkin/models/checkin.php +++ b/administrator/components/com_checkin/models/checkin.php @@ -71,7 +71,7 @@ public function checkin($ids = array()) } $query = $db->getQuery(true) - ->update($db->nameQuote($tn)) + ->update($db->quoteName($tn)) ->set('checked_out = 0') ->set('checked_out_time = '.$db->Quote($nullDate)) ->where('checked_out > 0'); @@ -146,7 +146,7 @@ public function getItems() { $query=$db->getQuery(true) ->select('COUNT(*)') - ->from($db->nameQuote($tn)) + ->from($db->quoteName($tn)) ->where('checked_out > 0'); $db->setQuery($query); diff --git a/administrator/components/com_contact/models/contacts.php b/administrator/components/com_contact/models/contacts.php index a07d7dd915bc1..0d1f947fc5627 100644 --- a/administrator/components/com_contact/models/contacts.php +++ b/administrator/components/com_contact/models/contacts.php @@ -198,11 +198,11 @@ protected function getListQuery() $query->where('a.id = '.(int) substr($search, 3)); } elseif (stripos($search, 'author:') === 0) { - $search = $db->Quote('%'.$db->getEscaped(substr($search, 7), true).'%'); + $search = $db->Quote('%'.$db->escape(substr($search, 7), true).'%'); $query->where('(ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')'); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.name LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } @@ -218,7 +218,7 @@ protected function getListQuery() if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { $orderCol = 'category_title '.$orderDirn.', a.ordering'; } - $query->order($db->getEscaped($orderCol.' '.$orderDirn)); + $query->order($db->escape($orderCol.' '.$orderDirn)); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index 94c39cf3a4b0f..9e07707b12538 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -209,11 +209,11 @@ protected function getListQuery() $query->where('a.id = '.(int) substr($search, 3)); } elseif (stripos($search, 'author:') === 0) { - $search = $db->Quote('%'.$db->getEscaped(substr($search, 7), true).'%'); + $search = $db->Quote('%'.$db->escape(substr($search, 7), true).'%'); $query->where('(ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')'); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } @@ -229,7 +229,7 @@ protected function getListQuery() if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { $orderCol = 'category_title '.$orderDirn.', a.ordering'; } - $query->order($db->getEscaped($orderCol.' '.$orderDirn)); + $query->order($db->escape($orderCol.' '.$orderDirn)); // echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index fcce04e3b8612..7c8d95bde0f59 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -116,7 +116,7 @@ function getListQuery($resolveFKs = true) if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.title LIKE '.$search.' OR a.alias LIKE '.$search); } } @@ -127,7 +127,7 @@ function getListQuery($resolveFKs = true) } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.title')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.title')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',(string)$query)); return $query; diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php index 732b989bdd452..727b72b243897 100644 --- a/administrator/components/com_installer/models/extension.php +++ b/administrator/components/com_installer/models/extension.php @@ -83,7 +83,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) } return array_slice($result, $limitstart, $limit ? $limit : null); } else { - $query->order($db->nameQuote($ordering) . ' ' . $this->getState('list.direction')); + $query->order($db->quoteName($ordering) . ' ' . $this->getState('list.direction')); $result = parent::_getList($query, $limitstart, $limit); $this->translate($result); return $result; diff --git a/administrator/components/com_languages/helpers/multilangstatus.php b/administrator/components/com_languages/helpers/multilangstatus.php index 292a5030cb05f..0a0351b5c6fa5 100644 --- a/administrator/components/com_languages/helpers/multilangstatus.php +++ b/administrator/components/com_languages/helpers/multilangstatus.php @@ -23,7 +23,7 @@ public static function getHomes() $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('COUNT(*)'); - $query->from($db->nameQuote('#__menu')); + $query->from($db->quoteName('#__menu')); $query->where('home = 1'); $query->where('published = 1'); $query->where('client_id = 0'); @@ -37,7 +37,7 @@ public static function getLangfilter() $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('COUNT(*)'); - $query->from($db->nameQuote('#__extensions')); + $query->from($db->quoteName('#__extensions')); $query->where('type = '.$db->Quote('plugin')); $query->where('element = '.$db->Quote('languagefilter')); $query->where('enabled= 1'); @@ -51,7 +51,7 @@ public static function getLangswitchers() $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('COUNT(*)'); - $query->from($db->nameQuote('#__modules')); + $query->from($db->quoteName('#__modules')); $query->where('module = ' . $db->quote('mod_languages')); $query->where('published = 1'); $query->where('client_id = 0'); @@ -90,7 +90,7 @@ public static function getHomepages() $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('language'); - $query->from($db->nameQuote('#__menu')); + $query->from($db->quoteName('#__menu')); $query->where('home = 1'); $query->where('published = 1'); $query->where('client_id = 0'); diff --git a/administrator/components/com_languages/models/languages.php b/administrator/components/com_languages/models/languages.php index 55ab7064d85ce..e651e92259649 100644 --- a/administrator/components/com_languages/models/languages.php +++ b/administrator/components/com_languages/models/languages.php @@ -126,12 +126,12 @@ protected function getListQuery() // Filter by search in title $search = $this->getState('filter.search'); if (!empty($search)) { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%', false); + $search = $db->Quote('%'.$db->escape($search, true).'%', false); $query->where('(a.title LIKE '.$search.')'); } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index 54d4ab038542c..4dd24d3f41e72 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -214,11 +214,11 @@ protected function getListQuery() $query->where('a.id = '.(int) substr($search, 3)); } elseif (stripos($search, 'link:') === 0) { if ($search = substr($search, 5)) { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.link LIKE '.$search); } } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('('.'a.title LIKE '.$search.' OR a.alias LIKE '.$search.' OR a.note LIKE '.$search.')'); } } @@ -258,7 +258,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.lft')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.lft')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',(string)$query)).'
'; return $query; diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index 7404ce9f6ce58..1baa619df39c9 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -150,7 +150,7 @@ protected function getListQuery() $query->group('a.id'); // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.id')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.id')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',(string)$query)).'
'; return $query; diff --git a/administrator/components/com_messages/models/messages.php b/administrator/components/com_messages/models/messages.php index 12abf2616f2da..14d15a6556435 100644 --- a/administrator/components/com_messages/models/messages.php +++ b/administrator/components/com_messages/models/messages.php @@ -125,12 +125,12 @@ protected function getListQuery() $search = $this->getState('filter.search'); if (!empty($search)) { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%', false); + $search = $db->Quote('%'.$db->escape($search, true).'%', false); $query->where('a.subject LIKE '.$search.' OR a.message LIKE '.$search); } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.date_time')).' '.$db->getEscaped($this->getState('list.direction', 'DESC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.date_time')).' '.$db->escape($this->getState('list.direction', 'DESC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_modules/models/modules.php b/administrator/components/com_modules/models/modules.php index 9193ccdbd63bf..70508f13fc29c 100644 --- a/administrator/components/com_modules/models/modules.php +++ b/administrator/components/com_modules/models/modules.php @@ -151,7 +151,7 @@ protected function _getList($query, $limitstart=0, $limit=0) if ($ordering == 'ordering') { $query->order('position ASC'); } - $query->order($this->_db->nameQuote($ordering) . ' ' . $this->getState('list.direction')); + $query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction')); if ($ordering == 'position') { $query->order('ordering ASC'); } @@ -279,7 +279,7 @@ protected function getListQuery() } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('('.'a.title LIKE '.$search.' OR a.note LIKE '.$search.')'); } } diff --git a/administrator/components/com_modules/models/positions.php b/administrator/components/com_modules/models/positions.php index f480b5c641b61..734dfca6e6413 100644 --- a/administrator/components/com_modules/models/positions.php +++ b/administrator/components/com_modules/models/positions.php @@ -104,7 +104,7 @@ public function getItems() $query->from('#__modules'); $query->where('`client_id` = '.(int) $clientId); if ($search) { - $query->where('position LIKE '.$this->_db->Quote('%'.$this->_db->getEscaped($search, true).'%')); + $query->where('position LIKE '.$this->_db->Quote('%'.$this->_db->escape($search, true).'%')); } $this->_db->setQuery($query); diff --git a/administrator/components/com_modules/models/select.php b/administrator/components/com_modules/models/select.php index f7e196858a6c6..e16ebee2f481f 100644 --- a/administrator/components/com_modules/models/select.php +++ b/administrator/components/com_modules/models/select.php @@ -98,7 +98,7 @@ protected function getListQuery() $query->where('a.enabled = 1'); // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_newsfeeds/models/newsfeeds.php b/administrator/components/com_newsfeeds/models/newsfeeds.php index b83797b098be6..d67328fd41d39 100644 --- a/administrator/components/com_newsfeeds/models/newsfeeds.php +++ b/administrator/components/com_newsfeeds/models/newsfeeds.php @@ -132,11 +132,11 @@ protected function getListQuery() ' a.published, a.access, a.ordering, a.language, a.publish_up, a.publish_down' ) ); - $query->from($db->nameQuote('#__newsfeeds').' AS a'); + $query->from($db->quoteName('#__newsfeeds').' AS a'); // Join over the language $query->select('l.title AS language_title'); - $query->join('LEFT', $db->nameQuote('#__languages').' AS l ON l.lang_code = a.language'); + $query->join('LEFT', $db->quoteName('#__languages').' AS l ON l.lang_code = a.language'); // Join over the users for the checked out user. $query->select('uc.name AS editor'); @@ -186,7 +186,7 @@ protected function getListQuery() } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.name LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } @@ -202,7 +202,7 @@ protected function getListQuery() if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { $orderCol = 'c.title '.$orderDirn.', a.ordering'; } - $query->order($db->getEscaped($orderCol.' '.$orderDirn)); + $query->order($db->escape($orderCol.' '.$orderDirn)); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_plugins/helpers/plugins.php b/administrator/components/com_plugins/helpers/plugins.php index 2ee2f26433b37..eb61813b83277 100644 --- a/administrator/components/com_plugins/helpers/plugins.php +++ b/administrator/components/com_plugins/helpers/plugins.php @@ -78,7 +78,7 @@ public static function folderOptions() $query->select('DISTINCT(folder) AS value, folder AS text'); $query->from('#__extensions'); - $query->where($db->nameQuote('type').' = '.$db->quote('plugin')); + $query->where($db->quoteName('type').' = '.$db->quote('plugin')); $query->order('folder'); $db->setQuery($query); diff --git a/administrator/components/com_plugins/models/plugins.php b/administrator/components/com_plugins/models/plugins.php index 6e8bb22f54111..1d2935107ab60 100644 --- a/administrator/components/com_plugins/models/plugins.php +++ b/administrator/components/com_plugins/models/plugins.php @@ -144,7 +144,7 @@ protected function _getList($query, $limitstart=0, $limit=0) $query->order('a.folder ASC'); $ordering = 'a.ordering'; } - $query->order($this->_db->nameQuote($ordering) . ' ' . $this->getState('list.direction')); + $query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction')); if($ordering == 'folder') { $query->order('a.ordering ASC'); } @@ -192,9 +192,9 @@ protected function getListQuery() ' a.enabled, a.access, a.ordering' ) ); - $query->from($db->nameQuote('#__extensions').' AS a'); + $query->from($db->quoteName('#__extensions').' AS a'); - $query->where($db->nameQuote('type').' = '.$db->quote('plugin')); + $query->where($db->quoteName('type').' = '.$db->quote('plugin')); // Join over the users for the checked out user. $query->select('uc.name AS editor'); @@ -231,7 +231,7 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.extension_id = '.(int) substr($search, 3)); } else { - $search = $db->quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->quote('%'.$db->escape($search, true).'%'); $query->where('(a.name LIKE '.$search.' OR a.folder LIKE '.$search.')'); } } diff --git a/administrator/components/com_redirect/models/link.php b/administrator/components/com_redirect/models/link.php index 6ff5069208664..20b0aa12c51e8 100644 --- a/administrator/components/com_redirect/models/link.php +++ b/administrator/components/com_redirect/models/link.php @@ -155,9 +155,9 @@ public function activate(&$pks, $url, $comment = null) if (!empty($pks)) { // Update the link rows. $db->setQuery( - 'UPDATE '.$db->nameQuote('#__redirect_links') . - ' SET '.$db->nameQuote('new_url').' = '.$db->Quote($url).', '.$db->nameQuote('published').' = 1, '.$db->nameQuote('comment').' = '.$db->Quote($comment) . - ' WHERE '.$db->nameQuote('id').' IN ('.implode(',', $pks).')' + 'UPDATE '.$db->quoteName('#__redirect_links') . + ' SET '.$db->quoteName('new_url').' = '.$db->Quote($url).', '.$db->quoteName('published').' = 1, '.$db->quoteName('comment').' = '.$db->Quote($comment) . + ' WHERE '.$db->quoteName('id').' IN ('.implode(',', $pks).')' ); $db->query(); diff --git a/administrator/components/com_redirect/models/links.php b/administrator/components/com_redirect/models/links.php index d9df5de227e32..3804c9987df6f 100644 --- a/administrator/components/com_redirect/models/links.php +++ b/administrator/components/com_redirect/models/links.php @@ -111,7 +111,7 @@ protected function getListQuery() 'a.*' ) ); - $query->from($db->nameQuote('#__redirect_links').' AS a'); + $query->from($db->quoteName('#__redirect_links').' AS a'); // Filter by published state $state = $this->getState('filter.state'); @@ -127,18 +127,18 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where( - '('.$db->nameQuote('old_url').' LIKE '.$search . - ' OR '.$db->nameQuote('new_url').' LIKE '.$search . - ' OR '.$db->nameQuote('comment').' LIKE '.$search . - ' OR '.$db->nameQuote('referer').' LIKE '.$search.')' + '('.$db->quoteName('old_url').' LIKE '.$search . + ' OR '.$db->quoteName('new_url').' LIKE '.$search . + ' OR '.$db->quoteName('comment').' LIKE '.$search . + ' OR '.$db->quoteName('referer').' LIKE '.$search.')' ); } } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.old_url')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.old_url')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_search/helpers/search.php b/administrator/components/com_search/helpers/search.php index 26eddb5d42e72..8289a6871ca27 100644 --- a/administrator/components/com_search/helpers/search.php +++ b/administrator/components/com_search/helpers/search.php @@ -118,7 +118,7 @@ static function logSearch($search_term) $params = JComponentHelper::getParams('com_search'); $enable_log_searches = $params->get('enabled'); - $search_term = $db->getEscaped(trim($search_term)); + $search_term = $db->escape(trim($search_term)); if (@$enable_log_searches) { diff --git a/administrator/components/com_search/models/searches.php b/administrator/components/com_search/models/searches.php index c4bdcef4e5ae1..74387efd343e9 100644 --- a/administrator/components/com_search/models/searches.php +++ b/administrator/components/com_search/models/searches.php @@ -105,7 +105,7 @@ protected function getListQuery() 'a.*' ) ); - $query->from($db->nameQuote('#__core_log_searches').' AS a'); + $query->from($db->quoteName('#__core_log_searches').' AS a'); // Filter by access level. if ($access = $this->getState('filter.access')) { @@ -116,12 +116,12 @@ protected function getListQuery() $search = $this->getState('filter.search'); if (!empty($search)) { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.search_term LIKE '.$search); } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.hits')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.hits')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_templates/models/styles.php b/administrator/components/com_templates/models/styles.php index 5fd8a856b8907..52156f942ae0d 100644 --- a/administrator/components/com_templates/models/styles.php +++ b/administrator/components/com_templates/models/styles.php @@ -141,13 +141,13 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.template LIKE '.$search.' OR a.title LIKE '.$search); } } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.name')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.name')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_templates/models/templates.php b/administrator/components/com_templates/models/templates.php index 3620c1cf7241f..2757ed22d48f7 100644 --- a/administrator/components/com_templates/models/templates.php +++ b/administrator/components/com_templates/models/templates.php @@ -98,13 +98,13 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.element LIKE '.$search.' OR a.name LIKE '.$search.')'); } } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.folder')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.folder')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/administrator/components/com_users/models/debuggroup.php b/administrator/components/com_users/models/debuggroup.php index 8333b44a598c2..18f16191f68e1 100644 --- a/administrator/components/com_users/models/debuggroup.php +++ b/administrator/components/com_users/models/debuggroup.php @@ -193,7 +193,7 @@ protected function getListQuery() // Filter the items over the search string if set. if ($this->getState('filter.search')) { // Escape the search token. - $token = $db->Quote('%'.$db->getEscaped($this->getState('filter.search')).'%'); + $token = $db->Quote('%'.$db->escape($this->getState('filter.search')).'%'); // Compile the different search clauses. $searches = array(); @@ -224,7 +224,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.lft')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.lft')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/administrator/components/com_users/models/debuguser.php b/administrator/components/com_users/models/debuguser.php index 645d81eb35c59..f9ee6a01ca457 100644 --- a/administrator/components/com_users/models/debuguser.php +++ b/administrator/components/com_users/models/debuguser.php @@ -183,7 +183,7 @@ protected function getListQuery() // Filter the items over the search string if set. if ($this->getState('filter.search')) { // Escape the search token. - $token = $db->Quote('%'.$db->getEscaped($this->getState('filter.search')).'%'); + $token = $db->Quote('%'.$db->escape($this->getState('filter.search')).'%'); // Compile the different search clauses. $searches = array(); @@ -214,7 +214,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.lft')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.lft')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/administrator/components/com_users/models/groups.php b/administrator/components/com_users/models/groups.php index d5c5a5a265e5f..f20ac3e871242 100644 --- a/administrator/components/com_users/models/groups.php +++ b/administrator/components/com_users/models/groups.php @@ -181,13 +181,13 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.title LIKE '.$search); } } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.lft')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.lft')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_users/models/level.php b/administrator/components/com_users/models/level.php index 0c58adc2c57ee..9a56505db65c6 100644 --- a/administrator/components/com_users/models/level.php +++ b/administrator/components/com_users/models/level.php @@ -58,7 +58,7 @@ protected function canDelete($record) if ((strpos($table, $prefix) === 0) && (isset($fields[$table]['access']))) { // Lookup the distinct values of the field. $query->clear('from') - ->from($db->nameQuote($table)); + ->from($db->quoteName($table)); $db->setQuery($query); $values = $db->loadResultArray(); diff --git a/administrator/components/com_users/models/levels.php b/administrator/components/com_users/models/levels.php index 10f67f9ecc5bc..ede6cbd42b4f5 100644 --- a/administrator/components/com_users/models/levels.php +++ b/administrator/components/com_users/models/levels.php @@ -110,7 +110,7 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('a.title LIKE '.$search); } } @@ -118,7 +118,7 @@ protected function getListQuery() $query->group('a.id'); // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.lft')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.lft')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_users/models/users.php b/administrator/components/com_users/models/users.php index b1a5f18219ecb..389375e750d8a 100644 --- a/administrator/components/com_users/models/users.php +++ b/administrator/components/com_users/models/users.php @@ -258,7 +258,7 @@ protected function getListQuery() // Filter the items over the search string if set. if ($this->getState('filter.search') !== '') { // Escape the search token. - $token = $db->Quote('%'.$db->getEscaped($this->getState('filter.search')).'%'); + $token = $db->Quote('%'.$db->escape($this->getState('filter.search')).'%'); // Compile the different search clauses. $searches = array(); @@ -277,7 +277,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.name')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.name')).' '.$db->escape($this->getState('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/administrator/components/com_weblinks/models/weblinks.php b/administrator/components/com_weblinks/models/weblinks.php index aaad2dd6fcca7..e68141b3bbcd7 100644 --- a/administrator/components/com_weblinks/models/weblinks.php +++ b/administrator/components/com_weblinks/models/weblinks.php @@ -186,7 +186,7 @@ protected function getListQuery() if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { - $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); + $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } @@ -202,7 +202,7 @@ protected function getListQuery() if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { $orderCol = 'category_title '.$orderDirn.', a.ordering'; } - $query->order($db->getEscaped($orderCol.' '.$orderDirn)); + $query->order($db->escape($orderCol.' '.$orderDirn)); //echo nl2br(str_replace('#__','jos_',$query)); return $query; diff --git a/components/com_banners/models/banners.php b/components/com_banners/models/banners.php index df5beea096d62..c6e59f6bd48f4 100644 --- a/components/com_banners/models/banners.php +++ b/components/com_banners/models/banners.php @@ -141,14 +141,14 @@ function getListQuery() $keyword=trim($keyword); $condition1 = "a.own_prefix=1 AND a.metakey_prefix=SUBSTRING(".$db->quote($keyword).",1,LENGTH( a.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=1 AND cl.metakey_prefix=SUBSTRING(".$db->quote($keyword).",1,LENGTH(cl.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=0 AND ".($prefix==substr($keyword,0,strlen($prefix))?'1':'0'); - $condition2="a.metakey REGEXP '[[:<:]]".$db->getEscaped($keyword) . "[[:>:]]'"; + $condition2="a.metakey REGEXP '[[:<:]]".$db->escape($keyword) . "[[:>:]]'"; if ($cid) { - $condition2.=" OR cl.metakey REGEXP '[[:<:]]".$db->getEscaped($keyword) . "[[:>:]]'"; + $condition2.=" OR cl.metakey REGEXP '[[:<:]]".$db->escape($keyword) . "[[:>:]]'"; } if ($catid) { - $condition2.=" OR cat.metakey REGEXP '[[:<:]]".$db->getEscaped($keyword) . "[[:>:]]'"; + $condition2.=" OR cat.metakey REGEXP '[[:<:]]".$db->escape($keyword) . "[[:>:]]'"; } $temp[]="($condition1) AND ($condition2)"; diff --git a/components/com_contact/models/category.php b/components/com_contact/models/category.php index 37de5dcf5b8fe..1f8adcbaf3253 100644 --- a/components/com_contact/models/category.php +++ b/components/com_contact/models/category.php @@ -165,7 +165,7 @@ protected function getListQuery() // Falll back to old style if the parameter hasn't been set yet. if (empty($initialSort)) { - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); } elseif ($initialSort != 'sortname'){ $query->order('a.'.$initialSort); diff --git a/components/com_contact/models/featured.php b/components/com_contact/models/featured.php index 4812aa043d864..755479ee2617e 100644 --- a/components/com_contact/models/featured.php +++ b/components/com_contact/models/featured.php @@ -156,7 +156,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/components/com_content/models/articles.php b/components/com_content/models/articles.php index 6159cf6e5037e..336b1a846e9ce 100644 --- a/components/com_content/models/articles.php +++ b/components/com_content/models/articles.php @@ -425,7 +425,7 @@ function getListQuery() // clean filter variable $filter = JString::strtolower($filter); $hitsFilter = intval($filter); - $filter = $db->Quote('%'.$db->getEscaped($filter, true).'%', false); + $filter = $db->Quote('%'.$db->escape($filter, true).'%', false); switch ($params->get('filter_field')) { diff --git a/components/com_content/models/category.php b/components/com_content/models/category.php index a357246409463..43c41af62579a 100644 --- a/components/com_content/models/category.php +++ b/components/com_content/models/category.php @@ -268,7 +268,7 @@ protected function _buildContentOrderBy() } if ($orderCol && $orderDirn) { - $orderby .= $db->getEscaped($orderCol) . ' ' . $db->getEscaped($orderDirn) . ', '; + $orderby .= $db->escape($orderCol) . ' ' . $db->escape($orderDirn) . ', '; } $articleOrderby = $params->get('orderby_sec', 'rdate'); @@ -277,7 +277,7 @@ protected function _buildContentOrderBy() $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', '; $primary = ContentHelperQuery::orderbyPrimary($categoryOrderby); - $orderby .= $db->getEscaped($primary) . ' ' . $db->getEscaped($secondary) . ' a.created '; + $orderby .= $db->escape($primary) . ' ' . $db->escape($secondary) . ' a.created '; return $orderby; } diff --git a/components/com_newsfeeds/models/category.php b/components/com_newsfeeds/models/category.php index 59869ba47eeda..dc4a1326295ee 100644 --- a/components/com_newsfeeds/models/category.php +++ b/components/com_newsfeeds/models/category.php @@ -143,7 +143,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/components/com_users/models/registration.php b/components/com_users/models/registration.php index aae50fd3e021a..596de5f328b90 100644 --- a/components/com_users/models/registration.php +++ b/components/com_users/models/registration.php @@ -43,10 +43,10 @@ public function activate($token) // Get the user id based on the token. $db->setQuery( - 'SELECT '.$db->nameQuote('id').' FROM '.$db->nameQuote('#__users') . - ' WHERE '.$db->nameQuote('activation').' = '.$db->Quote($token) . - ' AND '.$db->nameQuote('block').' = 1' . - ' AND '.$db->nameQuote('lastvisitDate').' = '.$db->Quote($db->getNullDate()) + 'SELECT '.$db->quoteName('id').' FROM '.$db->quoteName('#__users') . + ' WHERE '.$db->quoteName('activation').' = '.$db->Quote($token) . + ' AND '.$db->quoteName('block').' = 1' . + ' AND '.$db->quoteName('lastvisitDate').' = '.$db->Quote($db->getNullDate()) ); $userId = (int) $db->loadResult(); @@ -421,9 +421,9 @@ public function register($temp) if (count($sendEmail) > 0) { $jdate = new JDate(); // Build the query to add the messages - $q = "INSERT INTO ".$db->nameQuote('#__messages')." (".$db->nameQuote('user_id_from'). - ", ".$db->nameQuote('user_id_to').", ".$db->nameQuote('date_time'). - ", ".$db->nameQuote('subject').", ".$db->nameQuote('message').") VALUES "; + $q = "INSERT INTO ".$db->quoteName('#__messages')." (".$db->quoteName('user_id_from'). + ", ".$db->quoteName('user_id_to').", ".$db->quoteName('date_time'). + ", ".$db->quoteName('subject').", ".$db->quoteName('message').") VALUES "; $messages = array(); foreach ($sendEmail as $userid) { $messages[] = "(".$userid.", ".$userid.", '".$db->toSQLDate($jdate)."', '".JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT')."', '".JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username'])."')"; diff --git a/components/com_users/models/remind.php b/components/com_users/models/remind.php index e8925363bbeec..118c34c650da3 100644 --- a/components/com_users/models/remind.php +++ b/components/com_users/models/remind.php @@ -95,8 +95,8 @@ public function processRemindRequest($data) $db = $this->getDbo(); $query = $db->getQuery(true); $query->select('*'); - $query->from($db->nameQuote('#__users')); - $query->where($db->nameQuote('email').' = '.$db->Quote($data['email'])); + $query->from($db->quoteName('#__users')); + $query->where($db->quoteName('email').' = '.$db->Quote($data['email'])); // Get the user id. $db->setQuery((string) $query); diff --git a/components/com_weblinks/models/category.php b/components/com_weblinks/models/category.php index b4947c2f6b504..5c695c7ba1862 100644 --- a/components/com_weblinks/models/category.php +++ b/components/com_weblinks/models/category.php @@ -155,7 +155,7 @@ protected function getListQuery() } // Add the list ordering clause. - $query->order($db->getEscaped($this->getState('list.ordering', 'a.ordering')).' '.$db->getEscaped($this->getState('list.direction', 'ASC'))); + $query->order($db->escape($this->getState('list.ordering', 'a.ordering')).' '.$db->escape($this->getState('list.direction', 'ASC'))); return $query; } diff --git a/installation/models/database.php b/installation/models/database.php index 4175670bdc6a7..5a500262efee8 100644 --- a/installation/models/database.php +++ b/installation/models/database.php @@ -348,7 +348,7 @@ public function backupDatabase(& $db, $name, $prefix) // Get the tables in the database. $db->setQuery( 'SHOW TABLES' . - ' FROM '.$db->nameQuote($name) + ' FROM '.$db->quoteName($name) ); if ($tables = $db->loadResultArray()) { foreach ($tables as $table) @@ -360,7 +360,7 @@ public function backupDatabase(& $db, $name, $prefix) // Drop the backup table. $db->setQuery( - 'DROP TABLE IF EXISTS '.$db->nameQuote($backupTable) + 'DROP TABLE IF EXISTS '.$db->quoteName($backupTable) ); $db->query(); @@ -372,7 +372,7 @@ public function backupDatabase(& $db, $name, $prefix) // Rename the current table to the backup table. $db->setQuery( - 'RENAME TABLE '.$db->nameQuote($table).' TO '.$db->nameQuote($backupTable) + 'RENAME TABLE '.$db->quoteName($table).' TO '.$db->quoteName($backupTable) ); $db->query(); @@ -402,10 +402,10 @@ public function createDatabase(& $db, $name, $utf) { // Build the create database query. if ($utf) { - $query = 'CREATE DATABASE '.$db->nameQuote($name).' CHARACTER SET `utf8`'; + $query = 'CREATE DATABASE '.$db->quoteName($name).' CHARACTER SET `utf8`'; } else { - $query = 'CREATE DATABASE '.$db->nameQuote($name); + $query = 'CREATE DATABASE '.$db->quoteName($name); } // Run the create database query. @@ -437,7 +437,7 @@ public function deleteDatabase(& $db, $name, $prefix) // Get the tables in the database. $db->setQuery( - 'SHOW TABLES FROM '.$db->nameQuote($name) + 'SHOW TABLES FROM '.$db->quoteName($name) ); if ($tables = $db->loadResultArray()) { foreach ($tables as $table) @@ -446,7 +446,7 @@ public function deleteDatabase(& $db, $name, $prefix) if (strpos($table, $prefix) === 0) { // Drop the table. $db->setQuery( - 'DROP TABLE IF EXISTS '.$db->nameQuote($table) + 'DROP TABLE IF EXISTS '.$db->quoteName($table) ); $db->query(); @@ -521,7 +521,7 @@ public function setDatabaseCharset(& $db, $name) if ($db->hasUTF()) { // Run the create database query. $db->setQuery( - 'ALTER DATABASE '.$db->nameQuote($name).' CHARACTER' . + 'ALTER DATABASE '.$db->quoteName($name).' CHARACTER' . ' SET `utf8`' ); $db->query(); diff --git a/modules/mod_languages/helper.php b/modules/mod_languages/helper.php index 3575a0ffb2c27..cf7ec9b85ec86 100644 --- a/modules/mod_languages/helper.php +++ b/modules/mod_languages/helper.php @@ -26,7 +26,7 @@ public static function getList(&$params) $query->select('id'); $query->select('language'); - $query->from($db->nameQuote('#__menu')); + $query->from($db->quoteName('#__menu')); $query->where('home=1'); $db->setQuery($query); $homes = $db->loadObjectList('language'); diff --git a/modules/mod_login/helper.php b/modules/mod_login/helper.php index d8c3eb05d6f9a..cb7c547affafa 100644 --- a/modules/mod_login/helper.php +++ b/modules/mod_login/helper.php @@ -22,10 +22,10 @@ static function getReturnURL($params, $type) $db = JFactory::getDbo(); $query = $db->getQuery(true); - $query->select($db->nameQuote('link')); - $query->from($db->nameQuote('#__menu')); - $query->where($db->nameQuote('published') . '=1'); - $query->where($db->nameQuote('id') . '=' . $db->quote($itemid)); + $query->select($db->quoteName('link')); + $query->from($db->quoteName('#__menu')); + $query->where($db->quoteName('published') . '=1'); + $query->where($db->quoteName('id') . '=' . $db->quote($itemid)); $db->setQuery($query); if ($link = $db->loadResult()) { diff --git a/modules/mod_related_items/helper.php b/modules/mod_related_items/helper.php index e45a13fa6eaf7..ccf82ee553640 100644 --- a/modules/mod_related_items/helper.php +++ b/modules/mod_related_items/helper.php @@ -57,7 +57,7 @@ public static function getList($params) { $key = trim($key); if ($key) { - $likes[] = ',' . $db->getEscaped($key) . ','; // surround with commas so first and last items have surrounding commas + $likes[] = ',' . $db->escape($key) . ','; // surround with commas so first and last items have surrounding commas } } diff --git a/plugins/search/categories/categories.php b/plugins/search/categories/categories.php index 3b1fe04a9d993..fb52bf078f9a9 100644 --- a/plugins/search/categories/categories.php +++ b/plugins/search/categories/categories.php @@ -99,7 +99,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $order = 'a.title DESC'; } - $text = $db->Quote('%'.$db->getEscaped($text, true).'%', false); + $text = $db->Quote('%'.$db->escape($text, true).'%', false); $query = $db->getQuery(true); $return = array(); diff --git a/plugins/search/contacts/contacts.php b/plugins/search/contacts/contacts.php index 7d7e04ff69d38..9096f31140d08 100644 --- a/plugins/search/contacts/contacts.php +++ b/plugins/search/contacts/contacts.php @@ -98,7 +98,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $order = 'a.name DESC'; } - $text = $db->Quote('%'.$db->getEscaped($text, true).'%', false); + $text = $db->Quote('%'.$db->escape($text, true).'%', false); $rows = array(); if (!empty($state)) { diff --git a/plugins/search/content/content.php b/plugins/search/content/content.php index 52a757d47be7d..34ac1902e9110 100644 --- a/plugins/search/content/content.php +++ b/plugins/search/content/content.php @@ -73,7 +73,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $wheres = array(); switch ($phrase) { case 'exact': - $text = $db->Quote('%'.$db->getEscaped($text, true).'%', false); + $text = $db->Quote('%'.$db->escape($text, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE '.$text; $wheres2[] = 'a.introtext LIKE '.$text; @@ -89,7 +89,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { - $word = $db->Quote('%'.$db->getEscaped($word, true).'%', false); + $word = $db->Quote('%'.$db->escape($word, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE '.$word; $wheres2[] = 'a.introtext LIKE '.$word; diff --git a/plugins/search/newsfeeds/newsfeeds.php b/plugins/search/newsfeeds/newsfeeds.php index 8cb5306ba98da..f9ee25c5baab0 100644 --- a/plugins/search/newsfeeds/newsfeeds.php +++ b/plugins/search/newsfeeds/newsfeeds.php @@ -84,7 +84,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $wheres = array(); switch ($phrase) { case 'exact': - $text = $db->Quote('%'.$db->getEscaped($text, true).'%', false); + $text = $db->Quote('%'.$db->escape($text, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE '.$text; $wheres2[] = 'a.link LIKE '.$text; @@ -98,7 +98,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $wheres = array(); foreach ($words as $word) { - $word = $db->Quote('%'.$db->getEscaped($word, true).'%', false); + $word = $db->Quote('%'.$db->escape($word, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.name LIKE '.$word; $wheres2[] = 'a.link LIKE '.$word; diff --git a/plugins/search/weblinks/weblinks.php b/plugins/search/weblinks/weblinks.php index 53ee1d52ee45b..8d163c4ab4e67 100644 --- a/plugins/search/weblinks/weblinks.php +++ b/plugins/search/weblinks/weblinks.php @@ -89,7 +89,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) switch ($phrase) { case 'exact': - $text = $db->Quote('%'.$db->getEscaped($text, true).'%', false); + $text = $db->Quote('%'.$db->escape($text, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE '.$text; $wheres2[] = 'a.description LIKE '.$text; @@ -104,7 +104,7 @@ function onContentSearch($text, $phrase='', $ordering='', $areas=null) $wheres = array(); foreach ($words as $word) { - $word = $db->Quote('%'.$db->getEscaped($word, true).'%', false); + $word = $db->Quote('%'.$db->escape($word, true).'%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE '.$word; $wheres2[] = 'a.description LIKE '.$word;