]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add comment on "massive" "use" of "quotes"
authorAlan T. DeKok <aland@freeradius.org>
Fri, 29 Sep 2023 14:01:31 +0000 (10:01 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 29 Sep 2023 14:01:31 +0000 (10:01 -0400)
doc/antora/modules/installation/pages/upgrade.adoc

index ad976a485aeacbc17c810c313a0c2214314afc95..cd17b7b60b6991c178308ca459bda64b4500c06a 100644 (file)
@@ -1048,3 +1048,38 @@ Many "virtual" or "fake" attributes have been removed or renamed.
 `&Packet-Src-IP-Address` and `&Packet-Src-IPv6-Address` should be replaced by `&Net.Src.IP`.
 
 `&Packet-Src-Port` should be replaced by `&Net.Src.Port`.
+
+== Recommended Changes
+
+In v3, many people had a habit of just adding `"..."` around _everything_.  For example:
+
+.Bad practice - using "" everywhere
+[source,unlang]
+----
+update reply {
+       &Reply-Message := "%{User-Name}"
+}
+
+...
+
+if ("%{User-Name}" == "bob") {
+   ...
+}
+----
+
+This practice is not recommended.  It was never necessary, and it's not clear why it became a (bad) habit.
+
+In v4, it is clearer, simpler, and faster to just use `unlang` syntax correctly.
+
+.Good practice - just rely on the server to do the right thing
+
+[source,unlang]
+----
+&reply.Reply-Message := &User-Name
+
+...
+
+if (&User-Name == "bob") {
+   ...
+}
+----