Fixed issues with searching by username (#1722)

* Fixed issues with searching by username

* Update admin_user_search.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-12-21 19:15:13 +07:00 committed by GitHub
commit 1914e7be30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 7 deletions

View file

@ -9,6 +9,7 @@
- Show torrent's announcers list in `filelist.php` page [\#1708](https://github.com/torrentpier/torrentpier/pull/1708) ([belomaxorka](https://github.com/belomaxorka))
- [PHP 8.4] Fixed some deprecations [\#1718](https://github.com/torrentpier/torrentpier/pull/1718) ([belomaxorka](https://github.com/belomaxorka))
- [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka))
- Fixed issues with searching by username [\#1722](https://github.com/torrentpier/torrentpier/pull/1722) ([belomaxorka](https://github.com/belomaxorka))
- Fixed searching by username in `memberlist.php` [\#1721](https://github.com/torrentpier/torrentpier/pull/1721) ([belomaxorka](https://github.com/belomaxorka))
- Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705), [\#1713](https://github.com/torrentpier/torrentpier/pull/1713), [\#1715](https://github.com/torrentpier/torrentpier/pull/1715), [\#1717](https://github.com/torrentpier/torrentpier/pull/1717), [\#1719](https://github.com/torrentpier/torrentpier/pull/1719), [\#1720](https://github.com/torrentpier/torrentpier/pull/1720) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -252,8 +252,7 @@ if (!isset($_REQUEST['dosearch'])) {
$text = sprintf($lang['SEARCH_FOR_USERNAME'], strip_tags(htmlspecialchars(stripslashes($username))));
$username = str_replace("\*", '%', trim(strip_tags(strtolower($username))));
$username = str_replace('*', '%', trim(strip_tags(strtolower($username))));
if (str_contains($username, '%')) {
$op = 'LIKE';
} else {
@ -273,8 +272,7 @@ if (!isset($_REQUEST['dosearch'])) {
$text = sprintf($lang['SEARCH_FOR_EMAIL'], strip_tags(htmlspecialchars(stripslashes($email))));
$email = str_replace("\*", '%', trim(strip_tags(strtolower($email))));
$email = str_replace('*', '%', trim(strip_tags(strtolower($email))));
if (str_contains($email, '%')) {
$op = 'LIKE';
} else {
@ -568,8 +566,7 @@ if (!isset($_REQUEST['dosearch'])) {
$text = strip_tags(htmlspecialchars(stripslashes($userfield_value)));
$userfield_value = str_replace("\*", '%', trim(strip_tags(strtolower($userfield_value))));
$userfield_value = str_replace('*', '%', trim(strip_tags(strtolower($userfield_value))));
if (str_contains($userfield_value, '%')) {
$op = 'LIKE';
} else {

View file

@ -911,7 +911,7 @@ function username_search($search_match)
$username_list = '';
if (!empty($search_match)) {
$username_search = str_replace("\*", '%', clean_username($search_match));
$username_search = str_replace('*', '%', clean_username($search_match));
$sql = "
SELECT username