mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Added limit to search characters (#134)
* Update characters.php * Update config.php * Variable name change, better use LIMIT in query instead in loop * Just to be sure. Security first :) * use config function Co-authored-by: slawkens <slawkens@gmail.com> (cherry picked from commit dc536f0fc01862f052d5edee29ac188ac63fcf66)
This commit is contained in:
parent
357d487af7
commit
722264a083
@ -151,6 +151,9 @@ $config = array(
|
|||||||
4 => 'Knight Sample'
|
4 => 'Knight Sample'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// it must show limited number of players after using search in character page
|
||||||
|
'characters_search_limit' => 15,
|
||||||
|
|
||||||
// town list used when creating character
|
// town list used when creating character
|
||||||
// won't be displayed if there is only one item (rookgaard for example)
|
// won't be displayed if there is only one item (rookgaard for example)
|
||||||
'character_towns' => array(1),
|
'character_towns' => array(1),
|
||||||
|
@ -432,7 +432,7 @@ else
|
|||||||
if($db->hasColumn('players', 'deletion'))
|
if($db->hasColumn('players', 'deletion'))
|
||||||
$deleted = 'deletion';
|
$deleted = 'deletion';
|
||||||
|
|
||||||
$query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1;');
|
$query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1 LIMIT ' . (int)config('characters_search_limit') . ';');
|
||||||
if($query->rowCount() > 0)
|
if($query->rowCount() > 0)
|
||||||
{
|
{
|
||||||
echo 'Did you mean:<ul>';
|
echo 'Did you mean:<ul>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user