aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-10-16 16:15:05 +0200
committerKim Alvefur <zash@zash.se>2024-10-16 16:15:05 +0200
commit2ef0e122fd9508dce52471ac2b6585f998d6e7d5 (patch)
treec9e96e731e255be17d8222ed3ad8dd58e4e604e5 /util
parenteb612ac519a0f298a9697749b633596495084170 (diff)
downloadprosody-2ef0e122fd9508dce52471ac2b6585f998d6e7d5.tar.gz
prosody-2ef0e122fd9508dce52471ac2b6585f998d6e7d5.zip
util.xtemplate: Use same argument order in filters even without 'args'
This removes the different argument order used between '{x|foo}' and '{x|foo(y)}' because the differing order was awkward and confusing. This util does not seem to be widely used so should not be problematic to change this part. The only known use is in mod_pubsub, which does not use the filter function feature.
Diffstat (limited to 'util')
-rw-r--r--util/xtemplate.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/util/xtemplate.lua b/util/xtemplate.lua
index e23b1a01..446d7d1f 100644
--- a/util/xtemplate.lua
+++ b/util/xtemplate.lua
@@ -70,11 +70,7 @@ local function render(template, root, escape, filters)
end
elseif filters and filters[func] then
local f = filters[func];
- if args == nil then
- value, is_escaped = f(value, tmpl);
- else
- value, is_escaped = f(args, value, tmpl);
- end
+ value, is_escaped = f(value, args, tmpl);
else
error("No such filter function: " .. func);
end