33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 19:09:00 +00:00

Move the is_numeric($search) to it's own condition

This commit is contained in:
photodude 2015-12-17 09:39:55 -07:00
parent 30f950bab1
commit 9412ba14e4

View File

@ -128,10 +128,14 @@ class PullsModel extends \JModelDatabase
if (!empty($search))
{
if (stripos($search, 'id:') === 0 || is_numeric($search))
if (stripos($search, 'id:') === 0)
{
$query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3));
}
elseif (is_numeric($search))
{
$query->where('(' . $db->quoteName('a.id') . ' LIKE ' . (int) $search. ')');
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');