Changeset

11584:8bea29d1f82d

mod_server_contact_info: Generate properly escaped URIs from 'admins'
author Kim Alvefur <zash@zash.se>
date Fri, 11 Sep 2020 18:34:36 +0200
parents 11583:4ee7a6a8753e
children 11585:057ce005937e
files plugins/mod_server_contact_info.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_server_contact_info.lua	Fri Sep 11 18:34:06 2020 +0200
+++ b/plugins/mod_server_contact_info.lua	Fri Sep 11 18:34:36 2020 +0200
@@ -8,6 +8,7 @@
 
 local array = require "util.array";
 local jid = require "util.jid";
+local url = require "socket.url";
 
 -- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo
 local form_layout = require "util.dataforms".new({
@@ -25,7 +26,7 @@
 local admins = module:get_option_inherited_set("admins", {});
 
 local contact_config = module:get_option("contact_info", {
-	admin = array.collect( admins / jid.prep / function(admin) return "xmpp:" .. admin; end);
+	admin = array.collect(admins / jid.prep / function(admin) return url.build({scheme = "xmpp"; path = admin}); end);
 });
 
 module:add_extension(form_layout:form(contact_config, "result"));