Profiler/Profiles

* allow strings with less then 3 chars in name search
 * store name as binary to allow accent-sensitive search
   (note: guilds and arenateams have the same issue but utf8mb4_bin can't be applied blindly as the search also becomes case-sensitive (wich is already handled for profiles))
This commit is contained in:
Sarjuuk
2018-04-28 11:32:22 +02:00
parent b13f3af03e
commit c5e9762830
3 changed files with 4 additions and 3 deletions

View File

@@ -324,8 +324,8 @@ class ProfileListFilter extends Filter
// name [str] - the table is case sensitive. Since i down't want to destroy indizes, lets alter the search terms // name [str] - the table is case sensitive. Since i down't want to destroy indizes, lets alter the search terms
if (!empty($_v['na'])) if (!empty($_v['na']))
{ {
$lower = $this->modularizeString([$k.'.name'], Util::lower($_v['na']), !empty($_v['ex']) && $_v['ex'] == 'on'); $lower = $this->modularizeString([$k.'.name'], Util::lower($_v['na']), !empty($_v['ex']) && $_v['ex'] == 'on', true);
$proper = $this->modularizeString([$k.'.name'], Util::ucWords($_v['na']), !empty($_v['ex']) && $_v['ex'] == 'on'); $proper = $this->modularizeString([$k.'.name'], Util::ucWords($_v['na']), !empty($_v['ex']) && $_v['ex'] == 'on', true);
$parts[] = ['OR', $lower, $proper]; $parts[] = ['OR', $lower, $proper];
} }

View File

@@ -1827,7 +1827,7 @@ CREATE TABLE `aowow_profiler_profiles` (
`copy` int(10) unsigned DEFAULT NULL, `copy` int(10) unsigned DEFAULT NULL,
`icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user` int(11) unsigned DEFAULT NULL, `user` int(11) unsigned DEFAULT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(50) COLLATE utf8mb4_bin NOT NULL,
`race` tinyint(3) unsigned NOT NULL, `race` tinyint(3) unsigned NOT NULL,
`class` tinyint(3) unsigned NOT NULL, `class` tinyint(3) unsigned NOT NULL,
`level` tinyint(3) unsigned NOT NULL, `level` tinyint(3) unsigned NOT NULL,

View File

@@ -0,0 +1 @@
ALTER TABLE `aowow_profiler_profiles` CHANGE COLUMN `name` `name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_bin' AFTER `user`;