33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-01-03 15:17:22 +00:00

Fix backend filter using 'id:##' syntax (Fix #107)

This commit is contained in:
Michael Babker 2015-12-05 12:03:23 -05:00
parent d73715d9ac
commit 76de1805ff

View File

@ -128,12 +128,15 @@ class PullsModel extends \JModelDatabase
if (!empty($search))
{
$searchid = $db->quote($db->escape($search, true));
$search = $db->quote('%' . $db->escape($search, true) . '%');
$query->where(
'(' . $db->quoteName('a.title') . ' LIKE ' . $search . ') OR ' .
'(' . $db->quoteName('a.pull_id') . ' = ' . $searchid . ') '
);
if (stripos($search, 'id:') === 0)
{
$query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3));
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
$query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ')');
}
}
// Filter for applied patches