mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 14:22:44 +01:00
Sanitize node pubkey search
This commit is contained in:
parent
2faeb1071e
commit
a5575c0876
1 changed files with 1 additions and 1 deletions
|
@ -373,7 +373,7 @@ class NodesApi {
|
|||
|
||||
public async $searchNodeByPublicKeyOrAlias(search: string) {
|
||||
try {
|
||||
const publicKeySearch = search.replace('%', '') + '%';
|
||||
const publicKeySearch = search.replace(/[^a-zA-Z0-9]/g, '') + '%';
|
||||
const aliasSearch = search
|
||||
.replace(/[-_.]/g, ' ') // Replace all -_. characters with empty space. Eg: "ln.nicehash" becomes "ln nicehash".
|
||||
.replace(/[^a-zA-Z0-9 ]/g, '') // Remove all special characters and keep just A to Z, 0 to 9.
|
||||
|
|
Loading…
Add table
Reference in a new issue