From: Alan T. DeKok Date: Fri, 29 Sep 2023 14:01:31 +0000 (-0400) Subject: add comment on "massive" "use" of "quotes" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b914d08b2a6617ec7dba77ca8aec818c875eb54;p=thirdparty%2Ffreeradius-server.git add comment on "massive" "use" of "quotes" --- diff --git a/doc/antora/modules/installation/pages/upgrade.adoc b/doc/antora/modules/installation/pages/upgrade.adoc index ad976a485ae..cd17b7b60b6 100644 --- a/doc/antora/modules/installation/pages/upgrade.adoc +++ b/doc/antora/modules/installation/pages/upgrade.adoc @@ -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") { + ... +} +----