From: Nick Porter Date: Tue, 30 Sep 2025 11:08:18 +0000 (+0100) Subject: Test %ldap.uri.escape and %ldap.uri.unescape with multiple boxes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e79ee6af4df2195b151fc174e41bab8573b3df0c;p=thirdparty%2Ffreeradius-server.git Test %ldap.uri.escape and %ldap.uri.unescape with multiple boxes --- 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 == ',+"\<>;*=()')) {