mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 22:15:23 +01:00
Fix profile look-up being too permissive in web UI
This commit is contained in:
parent
97f6baf977
commit
51de6eb35f
1 changed files with 4 additions and 5 deletions
|
@ -4,11 +4,10 @@ import { ACCOUNT_LOOKUP_FAIL } from '../actions/accounts';
|
||||||
import { importAccounts } from '../actions/accounts_typed';
|
import { importAccounts } from '../actions/accounts_typed';
|
||||||
import { domain } from '../initial_state';
|
import { domain } from '../initial_state';
|
||||||
|
|
||||||
export const normalizeForLookup = str => {
|
const pattern = new RegExp(`@${domain}$`, 'gi');
|
||||||
str = str.toLowerCase();
|
|
||||||
const trailingIndex = str.indexOf(`@${domain.toLowerCase()}`);
|
export const normalizeForLookup = str =>
|
||||||
return (trailingIndex > 0) ? str.slice(0, trailingIndex) : str;
|
str.toLowerCase().replace(pattern, '');
|
||||||
};
|
|
||||||
|
|
||||||
const initialState = ImmutableMap();
|
const initialState = ImmutableMap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue