/etc/rc.kill_states is missing ?> at the end
-
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.
-
@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 ?>In short : an EOF is interpreted as a ?>.
-
Hm... Looks like NetGate again ignore needs to create code check routines;)
-
@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. -
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. -
@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.updateI picked random files and they all (4) had ?>, so I feel like most of them do.
-
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.