lib/irc: fix whitespace split in isURIPrefix

We want to get the last index of whitespace, not the first one.
This commit is contained in:
Simon Ser 2024-03-07 11:40:37 +01:00
parent 5d3738bc40
commit 57f7b1c011

View file

@ -278,9 +278,11 @@ function isWordBoundary(ch) {
}
function isURIPrefix(text) {
let i = text.search(space);
if (i >= 0) {
text = text.slice(i);
for (let i = text.length - 1; i >= 0; i--) {
if (text[i].search(space)) {
text = text.slice(i);
break;
}
}
i = text.indexOf("://");