]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test %ldap.uri.escape and %ldap.uri.unescape with multiple boxes
authorNick Porter <nick@portercomputing.co.uk>
Tue, 30 Sep 2025 11:08:18 +0000 (12:08 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 30 Sep 2025 11:08:18 +0000 (12:08 +0100)
src/tests/modules/ldap/xlat.unlang

index 67e1113afe5dbae60dd4a8e32dcfa27928443e73..1506aa90f7bcb14f1ee3c9e5ef68a3041b84c433 100644 (file)
@@ -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 == ',+"\<>;*=()')) {