equal
deleted
inserted
replaced
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 { |