Skip to content

Commit

Permalink
Fix #20072 Allow searching article content in backend
Browse files Browse the repository at this point in the history
Introduced a 'content:' prefix to search the article content
  • Loading branch information
smehrbrodt committed Apr 5, 2018
1 parent 68f074b commit 6644a0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions administrator/components/com_content/models/articles.php
Expand Up @@ -330,6 +330,11 @@ protected function getListQuery()
$search = $db->quote('%' . $db->escape(substr($search, 7), true) . '%');
$query->where('(ua.name LIKE ' . $search . ' OR ua.username LIKE ' . $search . ')');
}
elseif (stripos($search, 'content:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 8), true) . '%');
$query->where('(a.introtext LIKE ' . $search . ' OR a.fulltext LIKE ' . $search . ')');
}
else
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
Expand Down

0 comments on commit 6644a0e

Please sign in to comment.