মডিউল:URL: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
imported>Toohool
use unicode string functions
imported>Toohool
fix handling of port numbers and unencoded spaces
২০ নং লাইন:
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
local uri = mw.uri.new(url)
if uri.protocol == nil then
-- Handle URL's without a protocol, e.g. www.example.com/foo or www.example.com:8080/foo
if not uri.protocol ==or nil(uri.protocol and not uri.host) then
url = 'http://' .. url
uri = mw.uri.new(url)
৩০ ⟶ ৩৫ নং লাইন:
if uri.path == '/' then uri.path = '' end
local port = ''
text = mw.ustring.lower(uri.host or '') .. uri.relativePath
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. uri.relativePath
end