33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-01-23 15:18:36 +00:00

Refactor search filter (Fix #30)

This commit is contained in:
Michael Babker 2014-05-31 10:25:13 -05:00
parent b3c68f1935
commit ed0ccf0c5f

View File

@ -122,15 +122,12 @@ class PatchtesterModelPulls extends JModelList
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
{
$query->where($db->quoteName('a.pull_id') . ' = ' . (int) substr($search, 3));
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
$query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ')');
}
$search = $db->quote('%' . $db->escape($search, true) . '%');
$query->where(
'(' . $db->quoteName('a.title') . ' LIKE ' . $search . ') OR ' .
'(' . $db->quoteName('a.pull_id') . ' LIKE ' . $search . ') OR ' .
'(' . $db->quoteName('a.joomlacode_id') . ' LIKE ' . $search . ')'
);
}
// Handle the list ordering.