plugins/SpecialPageFuncs.php
changeset 1270 bd3ee7f12bc1
parent 1244 ba80cfffb673
child 1295 3c9c1b18567b
equal deleted inserted replaced
1269:35986c6b2150 1270:bd3ee7f12bc1
   641 		{
   641 		{
   642 			case 'username':
   642 			case 'username':
   643 				if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 )
   643 				if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 )
   644 				{
   644 				{
   645 					$search = '%' . escape_string_like($_GET['userinput']) . '%';
   645 					$search = '%' . escape_string_like($_GET['userinput']) . '%';
       
   646 					$lsearch = strtolower($search);
   646 					$min_id = ( isset($_GET['allow_anon']) && $_GET['allow_anon'] == '1' ) ? '1' : '2';
   647 					$min_id = ( isset($_GET['allow_anon']) && $_GET['allow_anon'] == '1' ) ? '1' : '2';
   647 					$q = $db->sql_query('SELECT username FROM ' . table_prefix . "users WHERE " . ENANO_SQLFUNC_LOWERCASE . "(username) LIKE '$search' AND user_id >= $min_id");
   648 					$q = $db->sql_query('SELECT username FROM ' . table_prefix . "users WHERE (" . ENANO_SQLFUNC_LOWERCASE . "(username) LIKE '$lsearch' OR username LIKE '$search') AND user_id >= $min_id");
   648 					if ( !$q )
   649 					if ( !$q )
   649 						$db->die_json();
   650 						$db->die_json();
   650 					
   651 					
   651 					while ( $row = $db->fetchrow($q) )
   652 					while ( $row = $db->fetchrow($q) )
   652 					{
   653 					{