With my code changed to a repl.it tested URL Detection code the following function seems to be causing WoW to not get past the loading screen:
Code:
function URLFind(str)
local _results = {}
local _x = 0
local isFound = false
while _x <= #str do
url = ""
pos = 0
url = string.match(str, "https?://[%w-_%.%?%.:/%+=&]+", _x)
pos = string.find(str, "https?://[%w-_%.%?%.:/%+=&]+", _x)
--print(url)
if url == nil then
--Didnt find fully matched URL so lets try a shorter one.
--url = string.match(str, "[^\.][^\s].*\.\.".."com".."[/]*\s?", _x)
url = string.match(str, "[%w-_%.%?%.:/%+=&]+", _x)
pos = string.find(str, "[%w-_%.%?%.:/%+=&]+", _x)
end
if url ~= nil then
if url:sub(1,1) == " " then
url = url:sub(2, #str)
pos = pos + 1
end
tinsert(_results, {url, pos})
--print(url.." | "..pos)
_x = pos + #url
--print("Adding. Next X: ".._x)
isFound = true
end
end
return isFound, _results
end
Anyone have an idea of why it would be doing that?