Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    /etc/rc.kill_states is missing ?> at the end

    Scheduled Pinned Locked Moved Development
    7 Posts 4 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pfpv
      last edited by

      I noticed that /etc/rc.kill_states is missing '?>' at the end. It still works but I thought I'd post it here, so in can be corrected to proper syntax.

      GertjanG 1 Reply Last reply Reply Quote 1
      • GertjanG
        Gertjan @pfpv
        last edited by

        @pfpv said in /etc/rc.kill_states is missing ?> at the end:

        /etc/rc.kill_states

        Check (all the/some) other files.
        Many miss the ending ?>

        Read php missing end ?>

        In short : an EOF is interpreted as a ?>.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        P 1 Reply Last reply Reply Quote 0
        • Sergei_ShablovskyS
          Sergei_Shablovsky
          last edited by

          Hm... Looks like NetGate again ignore needs to create code check routines;)

          —
          CLOSE SKY FOR UKRAINE https://youtu.be/_tU1i8VAdCo !
          Help Ukraine to resist, save civilians people’s lives !
          (Take an active part in public protests, push on Your country’s politics, congressmans, mass media, leaders of opinion.)

          1 Reply Last reply Reply Quote 1
          • P
            pfpv @Gertjan
            last edited by

            @gertjan said in /etc/rc.kill_states is missing ?> at the end:

            Check (all the/some) other files.
            Many miss the ending ?>

            I checked two other files before posting - they had ?>
            But apparently: "All PHP files MUST end with a non-blank line, terminated with a single LF.
            The closing ?> tag MUST be omitted from files containing only PHP."
            According to the Extended Coding Style.
            I am not a programmer but it did look like it was forgotten.

            1 Reply Last reply Reply Quote 1
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              As you have found out, that's intentional. If a file is only PHP, there is no need to close the tag and actually it's more harmful to close it since any trailing whitespace (or anything, really) after the final ?> could introduce errors or unintended output.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              P 1 Reply Last reply Reply Quote 0
              • P
                pfpv @jimp
                last edited by

                @jimp said in /etc/rc.kill_states is missing ?> at the end:

                As you have found out, that's intentional. If a file is only PHP, there is no need to close the tag and actually it's more harmful to close it since any trailing whitespace (or anything, really) after the final ?> could introduce errors or unintended output.

                I feel like I opened a can of worms. Most other files in /etc that start with rc. and written in PHP do have ?> at the end. Here is a list of files with ?> that I checked and then stopped checking:
                /etc/rc.filter_configure
                /etc/rc.bootup
                /etc/rc.reload_all
                /etc/rc.dyndns.update

                I picked random files and they all (4) had ?>, so I feel like most of them do.

                1 Reply Last reply Reply Quote 1
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  It's not that significant a concern, so nobody has taken the time to clean them all up. They should probably be removed for consistency, but it's not a priority.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.