From 6644a0e46826b29cb5af4ba357fd40a6066207a2 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 5 Apr 2018 11:54:05 +0200 Subject: [PATCH] Fix #20072 Allow searching article content in backend Introduced a 'content:' prefix to search the article content --- administrator/components/com_content/models/articles.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index c38c16b5d5293..0f30feab5947d 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -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) . '%'));