From e79ee6af4df2195b151fc174e41bab8573b3df0c Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Tue, 30 Sep 2025 12:08:18 +0100 Subject: [PATCH] Test %ldap.uri.escape and %ldap.uri.unescape with multiple boxes --- src/tests/modules/ldap/xlat.unlang | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tests/modules/ldap/xlat.unlang b/src/tests/modules/ldap/xlat.unlang index 67e1113afe..1506aa90f7 100644 --- a/src/tests/modules/ldap/xlat.unlang +++ b/src/tests/modules/ldap/xlat.unlang @@ -42,6 +42,21 @@ if (!(result_string == '\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29')) { test_fail } +# Multiple boxes on the input +control += { + Filter-Id = 'safe' + Filter-Id = 'non safe,+' +} +control.Filter-Id := %ldap.uri.escape(control.Filter-Id[*]) +if ((control.Filter-Id[0] != 'safe') || (control.Filter-Id[1] != 'non safe\2c\2b')) { + test_fail +} + +control.Filter-Id := %ldap.uri.unescape(control.Filter-Id[*]) +if ((control.Filter-Id[0] != 'safe') || (control.Filter-Id[1] != 'non safe,+')) { + test_fail +} + result_string := %ldap.uri.unescape(%{result_string}) if (!(result_string == ',+"\<>;*=()')) { -- 2.47.3