diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index d86ecf665..d429299e1 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -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.